Php Objective Questions with Answers for written test exams 70

Question 70
The requirement is to return true for the case in which a string $str contains

another string $substr after the first character of $str? Which of the following

will return true when string $str contains string $substr, but only after the first

character of $str?

I.


function test($str, $substr) {

return strpos(substr($str,1), $substr) >= 0;

\}

?>

II.


function test($str, $substr) {

return strrchr($str, $substr) !== false;

\}

?>

III.


function test($str, $substr) {

return strpos($str, $substr) > 0;

\}

?>

A. I only

B. II only

C. III only

D. I and II

E. I and III

F. II and III
Answers 70


C

  







Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---