Click here to Skip to main content
14,453,136 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi every body,

i have a string contain: sample1,sample2,sample3 ......

how can i coustimized to be: "sample1","sample2","sample3".......


my question is how to insert the double qoutes directly:

$sample = 'sample1,sample2,sample3';

how can i make it like that

$d = '"sample1","sample2","sample3"';


Regards
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

Some string manipulation discussions here[^] - maybe they can help you.
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

I don't know proper PHP syntax, but

0. sample1,sample2,sample3
1. "sample1,sample2,sample3" : enclose in double quotes
2. "sample1","sample2","sample3" : replace , with ","
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100