Q:

Write a PHP script to remove a part of a string from the beginning

0

Write a PHP script to remove a part of a string from the beginning.

Sample string : 'rayy@example.com'

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$sub_string = 'rayy@';
$str = 'rayy@example.com';
if (substr($str, 0, strlen($sub_string)) == $sub_string) 
{
 $str = substr($str, strlen($sub_string));
}
echo $str."\n";
?>

Sample Output:

example.com

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now