I am reading a long string coming from an editor using PHP. It misses the first line. Please see the code below.
$separator = "\r\n";
$line = strtok($article, $separator);
while ($line !== false) {
# do something with $line
$line = strtok( $separator );
echo $line;
}
If the text is like -
Line1Line1Line1Line1 Line1Line1Line1
Line2Line2Line2Line2 Line2Line2Line2
Line3Line3Line3 Line3Line3
Then it prints from the second one.
Any help is highly appreciated.
$line = strtok($article, $separator);will have the first line.