Mohamed Oualli Mohamed Oualli - 4 months ago 12
PHP Question

extract the numbers diference betwin tow string

I have

string1 = "1234567891011121314151617181920"

and I have
string2 = "123"


How can I extract
string3
to equal
"4567891011121314151617181920"
starting from
string1
and
string2
in PHP?

I have try this but no results

foreach($dejasprise as $k=>$v){
$prises = $v;
echo $prises."<br />";
foreach($options as $key=>$value ){
if($value == $prises){
echo "non</br>";
}
else
{
echo $value."<br />";
}
}

Answer

I think you are trying to trim string2 from string1, and the end result is string3. Try $string3 = str_replace($string2,"",$string1)