substr():-

The substr() function returns a part of a string.

strlen():-

The strlen() function returns the length of a string.

code:-

<?php
$substring = 'is';
$str1 = 'is it you';
if (substr($str1, 0, strlen($substring)) == $substring) 
{
 $str1 = substr($str1, strlen($substring));
}
echo $str1;
?>


output:-

 it you

Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post