Return the portion of a string before the first occurrence of a character in PHP [duplicate]

For googlers: strtok is better for that:

echo strtok("The quick brown fox", ' ');

Leave a Comment