Skip to content
Advertisement

How to convert array to different type [closed]

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

how to convert to [“dev2″,”dev3″,”dev4”]

Advertisement

Answer

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

I hope this is what you want.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement