<<< Previous question <<< Question ID#0421.md >>> Next question >>>
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?
$haystack聽=聽'abcda';
$needle聽聽聽=聽'a';
$pos聽=聽strpos($haystack,聽$needle);
if聽(!$pos)聽{
echo聽"miss";
} else聽{
聽聽聽聽echo聽"hit聽"聽.聽$pos;
}Enter the exact script output
- A) miss
- B) hit3
- C) hit0
- D) hit1
Answer
Answer: A