2013-12-14 126 views

回答

1
$string='Hello this is the-end'; 
$remove='end'; 
$i=strrpos($string, $remove); 
if ($i===strlen($string)-strlen($remove)) $string=substr($string, 0, $i-1); 
var_dump($string); 
+0

看起來比以前困難得多,但謝謝!我會在下列情況下接受:D – user2943677