Contact: aviboots(AT)netvision.net.il
39,971 questions
51,913 answers
573 users
$multiLineString = "First line\n" . "Second line\n" . "Third line\n" . "Fourth line"; $firstLine = substr($multiLineString, 0, strpos($multiLineString, "\n")); echo "The first line is: " . $firstLine; /* run: The first line is: First line */
$multiLineString = "First line\n" . "Second line\n" . "Third line\n" . "Fourth line"; $firstLine = strtok($multiLineString, "\n"); echo "The first line is: " . $firstLine; /* run: The first line is: First line */