Is there any function, for example, that contains Java for PHP?

I would like to know if there is any function that searches for a string in a string and returns a boolean value in PHP, tells whether the string contains or not, for example the method contains in Java?

+6
source share
1 answer

You can try strpos() , http://php.net/strpos

 $str = "This is a sample string."; $findMe = "sample"; if (strpos($str, $findMe) !== false) { // you found me! } 
+9
source

Source: https://habr.com/ru/post/920453/


All Articles