My textarea ( $_POST['data'] ) contains 10 strings, each separated by a new line (\n). For example:
January
February
March
April
May
Jun
July
August
September
November
In PHP, how can I select only the first 5 elements from this $_POST['data']?
I tried:
$_POST['data'] = array_slice(explode("\n", $_POST['data']), 0, 5);
but it doesn't seem to work..