假设我有这个功能:
function f($string){
$string = preg_replace("`\[.*\]`U","",$string);
$string = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$string);
$string = htmlentities($string, ENT_COMPAT, 'utf-8');
$string = preg_replace( "`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig|quot|rsquo);`i","\\1", $string );
$string = preg_replace( array("`[^a-z0-9]`i","`[-]+`") , "-", $string);
return $string;
}
我怎样才能扭转这个功能......即。我应该如何编写函数 fReverse() 以便我们拥有以下内容:
$s = f("some string223---");
$reversed = fReverse($s);
echo $s;
并输出:一些string223---