We have a string of email ID with abuhozaifa8@gmail.com  and we want to check @ exist in a string with PHP, so will use simple strchr() function of PHP and will check @ or any other character exists in the string.

You can learn more about strchr() from w3school.com

How To Check Whether a Character Exists in a String PHP?

$string = "abuhozaifa8@gmail.com";
if(strchr($string, '@')) {
    echo '@ Exist in String';
else {
    echo "Doesn't Exist";


@ Exist in String
Changed status to publish