Basically I have an array with several string as values (not associative array). I need to get particular parts of each string and transform it into an array with two values.
Here's the structure of my array:
$data = array(
"A1 -- B1",
"A2 -- B2",
"A3 -- B3",
"A1 -- A2",
"A2 -- A3",
"B2 -- B3",
"B1 -- B3",
);
So I need each of these values to become an array like so:
$data = array(
array("A1", "B1");
array("A2", "B2");
...
);
I've been thinking about using preg_split to break each string down but couldn't get it to work within an array. Not sure preg_split is the best way to do it, so I'm open to suggestions.
Thanks