I'm quite new to PHP and coming from a Java background. So here it goes:
I have this code:
$selected = array();
foreach($this->getSelectedOptions() AS $array) {
array_push($selected, $array['value']);
}
var_dump($selected);
getSelectedOptions() retrieves an array of arrays containing strings.
The result is
array
0 => string 'abc, def' (length=31)
I was expecting something like this though:
Array
(
[0] => abc
[1] => def
)
Why is this happening? How can I make my array look like the latter (without doing any post-processing with commas etc.)
Thanks!