Examveda
Examveda

What will be the output of the following PHP code?
<?php
$url = "contact@examveda.com";
echo ltrim(strstr($url, "@"),"@");
?>

A. contact@examveda.com

B. contact

C. contact@

D. examveda.com

Answer: Option D

Solution(By Examveda Team)

The strstr() function returns the remainder of a string beginning with the first occurrence of a predefined string.

This Question Belongs to PHP >> Regular Expressions

Join The Discussion

Related Questions on Regular Expressions