Write a PHP script to remove a part of a string from the beginning.
Sample string : 'rayy@example.com'
<?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
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer