Return the portion of a string before the first occurrence of a character in PHP [duplicate] March 1, 2023 by Tarik For googlers: strtok is better for that: echo strtok("The quick brown fox", ' ');