Hi all. If I have this string...
john riley,clare simpson,joe downs
How can I change the string to hane quotes around the names...
"john riley","clare simpson","joe downs"
str_pos() to find the location of the commas and substr_replace() to insert the "s, or you could use a regex. Just my thoughts.
You can use a trick sometimes used to construct SQL statements:
$str = 'john riley,clare simpson,joe downs'; $str = explode(',', $str); $str = '"' . implode('","', $str) . '"';
Works perfect laser!!