i have an array like this, with x-coordinate and y-coordinate forming an individual entry.
$polygon = array("10 0", "20 5", "15 15", "22 15");
Now how can i break this array into 2 different arrays, such that all x-coordinates will fall into one array and all y-coordinates will fall into another array, like this:
$x = array(10, 20, 15, 22);
$y = array(0, 5, 15, 15);