Q. What will the following code output?
<?php
echo strpos('hello world', 'world');
?>
Code:
echo strpos('hello world', 'world');
β
Correct Answer: (A)
6
Explanation: strpos() returns the position of the first occurrence; 'world' starts at position 6.