• Increase font size
  • Default font size
  • Decrease font size
English (United Kingdom)Български (България)
Home Category Table The strpos() function

The strpos() function

E-mail Print PDF
There are no translations available.

The strpos() function is used to search for character within a string.
If a match is found, this function will return the position of the first match. If no match is found, it will return FALSE.

<?php
echo strpos("Hello world!","world");
?>


Result:

6

  • The position of the string "world" in our string is position 6. The reason that it is 6 (and not 7), is that the first position in the string is 0, and not 1.
 

Add comment


Security code
Refresh

Main Menu


download-joomla


download-joomla