I'm having a problem in imploding an array to comma separated with double quotation. My Script is as below:
<?php
$arr = array(1,2,3,4,5,6,7,8,9);
$string = rtrim(implode('", ', $arr), ',');
echo $string;
The output is:
1", 2", 3", 4", 5", 6", 7", 8", 9
But I want this output below:
"1", "2", "3", "4", "5", "6", "7", "8", "9"
So anyone can help me with this problem please?
Thanks!
$string = '"' . implode('", "', $arr) . '"';
, this would solve it, but why would you need such output?