strpos in PHP works in a different way. If you are used to Java then it will come as no surprise that you will have your head scratching into confusion why it does not give the correct output.
So far in the strpos PHP page, contributors gave their own versions of strpos. The most accurate and the function that worked the way I wanted it to the same way that indexOf works in Java is by contributor firstname.lastname@example.org.
I find this stupid. It would have been easier if it still returned an int value like the usual -1 to indicate it didn’t find any substring inside the string.
To do an if statement using strpos() of PHP just like this Java code: