I am storing user messages in an array and i want to filter out the nonsense and store the valuable data in a log.
The array size is being generated by the user message which means the array can be any size depending on the size of the messsage.
So lets give an example
Say i have an array that looks like the following:
 => some nonsense
 => some more nonsense
 => even more nonsense
 => valuable data
 => some more valuable data
 => even more valuable data
 => so much valuable data
You can do this using
array array_slice ( array $array , int $offset [, int $length = NULL [, bool $preserve_keys = false ]] )
In your case, you should do:
$arr = array_slice($arr, 3); // Gives you from , ... till the end.
offset parameter to be
offsetis non-negative, the sequence will start at that offset in the array. If
offsetis negative, the sequence will start that far from the end of the array.
If you want to preserve the keys, you need to give another
true at the end.
$arr = array_slice($arr, 3, null, true);