detect before str php code example
Example 1: find in php string or
$a = 'How are you?';
if (strpos($a, 'are') !== false) {
echo 'true';
}
Example 2: php get string before character
$arr = explode("/", $string, 2);
$first = $arr[0];
$a = 'How are you?';
if (strpos($a, 'are') !== false) {
echo 'true';
}
$arr = explode("/", $string, 2);
$first = $arr[0];