$variable = substr($variable, 0, strpos($variable, "By"));
In plain english: Give me the part of the string starting at the beginning and ending at the position where you first encounter the deliminator.
More Related Contents:
- How to include a PHP variable inside a MySQL statement
- PHP random string generator
- How to generate a random, unique, alphanumeric string?
- How to Truncate a string in PHP to the word closest to a certain number of characters?
- How do I strip all spaces out of a string in PHP? [duplicate]
- Highlight the difference between two strings in PHP
- How to replace Microsoft-encoded quotes in PHP
- PHP string replace match whole word
- Curly braces in string in PHP
- Insert string at specified position
- In PHP, what does “
- Split camelCase word into words with php preg_match (Regular Expression)
- How can I capture the result of var_dump to a string?
- PHP – remove tag from string
- Can you append strings to variables in PHP? [duplicate]
- Concatenation with addition in it doesn’t work as expected
- Get characters after last / in url
- Manipulate a url string by adding GET parameters
- Convert a String into an Array of Characters
- Methods to remove specific characters from string?
- How to remove the leading character from a string?
- PHP: Best way to extract text within parenthesis?
- How do I remove the last comma from a string using PHP?
- Do I need to escape backslashes in PHP?
- PHP prepend leading zero before single digit number, on-the-fly [duplicate]
- Using str_split on a UTF-8 encoded string
- How to remove all leading zeroes in a string
- How to prefix a positive number with plus sign in PHP
- Format 32-character string with hyphens to become UUID
- finding common prefix of array of strings