I would like to select the first line of a string that contains many newlines. For example:
$mystring = "First line
second line
third line";
My problem arrives when I try to select every character, starting at the beginning of the file, that is not a newline until the first newline. (if that makes any sense)
something like this seems intuitive but doesn't work.
ereg('[(\n)]*\n', $mystring, $myarray);
Your thoughts are greatly appreciated