Php Objective Questions with Answers for written test exams 20

Question 20
Given

$email = ‘bob@example.com’;

which code block will output example.com?

A. print substr($email, -1 * strrpos($email, ‘@’));

B. print substr($email, strrpos($email, ‘@’));

C. print substr($email, strpos($email, ‘@’) + 1);

D. print strstr($email, ‘@’);

Answers 20


Answer C is correct. strpos() identifies the position of the @ character in the

string.To capture only the domain part of the address, you must advance one place

to the first character after the @.

  







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 ---