Zend PHP 5.3 Certification Exam


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  • Question 23/31

    The strpos() function is used to determine the position in a string of the given search string. If the search string cannot be found, false is returned.

    What is the output of the following script?

    
    <?php
        $haystack 'abcda';
        $needle   'a';
    
        $pos strpos($haystack$needle);
    
        if (!$pos) {
            echo "miss";
        }
        else {
            echo "hit " $pos;
        }
    ?>
    
    
    Enter the exact script output