Posted On: Apr 15, 2024
In PHP both functions are used to find the first occurrence of a substring in a string except
stristr() is case-insensitive and strstr is case-sensitive, if no match is found then FALSE will be returned.
Sample Usage:
<?php $email = ‘abc@xyz.com’; $hostname = strstr($email, ‘@’); echo $hostname; output: @xyz.com ?>
stristr() does the same thing in Case-insensitive manner.
Never Miss an Articles from us.
T_PAAMAYIM_NEKUDOTAYIM is scope resolution operator used as :: (double colon) .Basically, it used to call static methods/variables of a Class...
In PHP == is equal operator and returns TRUE if $a is equal to $b after type juggling and === is Identical operator and return TRUE if $a is equal to $b, and they are of the same data type...