Jump to content

Modify string


kristian_gl

Recommended Posts

Hey guys and girls

I need to modify a string that look like this: "yes no yes" into a string that look like this: "NULL, \'yes\', \'no\', \'yes\'"

 

so far I got this code:

 

$arr= $_POST;

$string = implode (" ", $arr);
	$string = ", \'" . $string . "\'";

$string = "NULL" . $string; 
echo $string;

 

but it's output is: "NULL, \'yes no yes\'"

 

Any help would be much appreciated

 

Kristian

Link to comment
https://forums.phpfreaks.com/topic/199698-modify-string/
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.