PHP question

Discussion in 'Programming' started by Lifeonblack, Jul 7, 2018.

Thread Status:
Not open for further replies.
  1. Hi there so the
    The PHP strpos() function searches for a specific text within a string.

    If a match is found, the function returns the character position of the first match. If no match is found, it will return FALSE.

    The example below searches for the text "world" in the string "Hello world!":
    source: https://www.w3schools.com/php/php_string.asp

    but if I did this thing
    Code (PHP):
    <?php
    echo strpos("Hello world!", "world");
    ?>
    the output is 6 since it will find the specific text within a string it will be 8 for me double ll in "heLLo" and one o in hellO" the rest is in the word "world" or I'm wrong in analyzing the explanation. My native language is not english so explain in simple worlds thank you.
     
Thread Status:
Not open for further replies.