Home>Article>Backend Development> Things to note when using the strpos() function when learning PHP

Things to note when using the strpos() function when learning PHP

little bottle
little bottle forward
2019-04-22 14:42:06 2511browse

The main content of this article is about the precautions for using the strpos() function in PHP. Interested friends can learn about it!

Returns the first position where the character appears. If the character is at the beginning of the searched string, '0' will be returned

Therefore, when using this function to determine whether the string contains a certain Characters are used:


if(strpos('string','str') !== false){ // ... }

If you want to know more about PHP, please pay attention toPHP video tutorialonPHP中文网!

The above is the detailed content of Things to note when using the strpos() function when learning PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete