I have a following string
$data = "20150825131738_262,20150825132227_241,20150825132254_898,20150825132320_209";
How to add '
in $data
. So the resultant output is as follows
'20150825131738_262','20150825132227_241','20150825132254_898','20150825132320_209,20150825132346_124','20150825132406_744','20150825143522_447','20150828145011_928'
help me thank's
Following would give you the desired results
$data = "20150825131738_262,20150825132227_241,20150825132254_898,20150825132320_209";
$data_array = explode(',', $data);
$data = "'". implode("','", $data_array) . "'";
print_r($data);
See it running online here
Try This
$arr=explode(',', $data);
implode("','",$arr);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With