Jump to content

Comma Delimiter Question


foochuck

Recommended Posts

I'm using the explode function...

 

$pizza  = "piece1,piece2,piece3,piece4,piece5,piece6";
$pieces = explode(",", $pizza);
echo $pieces[0]; // piece1

 

I would like to include an actual comma "," in the pizza variable and have it appear in the string. For example I want:

 

"piece,1,piece,2,piece,3,piece,4,piece,5,piece,6";

 

This isn't the real working sample. Anyway, my main question is how do I escape the actual commas so they are kept in the strings and distinguished from the delimiter commas???

 

Thanks

 

FOO

Link to comment
https://forums.phpfreaks.com/topic/116273-comma-delimiter-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.