Home > front end >  How to convert array to different type
How to convert array to different type

Time:09-21

i have Array ( [0] => dev2 [1] => dev3 [2] => dev4 )

how to convert to ["dev2","dev3","dev4"]

CodePudding user response:

$old_array = array( 'dev2', 'dev3', 'dev4');
$new_array = json_encode($old_array);
echo $new_array;

I hope this is what you want.

  • Related