how can i convert this array
array:1 [
0 => "Cambodia, Japan"
]
into like this $destinations = ['Cambodia','Japan'];
CodePudding user response:
Simply use the PHP explode()
function.
$array = [ "Cambodia, Japan" ];
$destinations = explode(', ', $array[0]);