How can I convert this Array:
$data = Array
(
[0] => Array
(
[0] => 125
[pcode] => 125
)
[1] => Array
(
[0] => 275
[pcode] => 275
)
[2] => Array
(
[0] => 600
[pcode] => 600
)
[3] => Array
(
[0] => 675
[pcode] => 675
)
[4] => Array
(
[0] => 1031
[pcode] => 1031
)
[5] => Array
(
[0] => C335
[pcode] => C335
)
)
into a string like this:
$new_string=" '125','275','600','675','1031','C335' ";
implode(',', array_map(function ($item) { return "'" . $item[0] . "'"; }, $data));. Example here.