Hello, can I somehow make that something is recognized in a sentence? So e.g. you now write "Hello people, what's up?" And now I want to check whether there is an "ello" in there. So the "ello" of Hello. How can I check this so the "ello" check of the whole text? (sry my english is bad :c) FlxiBoy.
If I'm not mistaken, you can use strpos to search `ello` in a string PHP: // The !== operator can be used. Using != would not work as expectedif (strpos("Hello world!", "ello") === false) { echo "The string was not found";} else { echo "The string was found ";}
PHP: if (!strpos("Hello world!", "ello")) { echo "The string was not found";} else { echo "The string was found ";} Could you explain for me the different between these two?
Strpos Returns the position of the first occurrence of a string inside another string, or FALSE if the string is not found. My code and your code is basically same I believe. I just kept === false for new users to understand it easily. Simply == would not work as expected because the position of the character was the 0th (first) character.