I have an array that is in a certain order and I want to just cutoff a portion of the array starting from the first index to the index of a given key.
IE…
If i had this array
$array = array("0" => 'blue', "1" => 'red', "2" => 'green', "3" => 'red', "4"=>"purple");
I want to cut off the first part of the array before the key “2” (as a string) is seen.
So the end array would be something like…
“2” => ‘green’
“3” => ‘red’
“4”=>’purple’
Thanks,
Ian
For your case you can use
EDIT: For edited question
Then use $cloneArray