[a] => Array (
[0] => MongoId Object (
[$id] => 506479dc9a5be1596b1bd97d
),
[1] => MongoId Object (
[$id] => 506479dc9a5be1596b1bd97d
)
)
I have an array like this one. I need to change the values to string, to change it to something like this:
array (
0 => "506479dc9a5be1596b1bd97d",
1 => "506479dc9a5be1596b1bd97d",
)
This is my solution, but it is expensive and I will be using this in a for loop.
$yut = implode(",", $a);
$arr = explode(",", $yut);
Are there any other solution?