コメントの削除
Posted feedbacks - PHP
token_get_all関数を使うと楽が出来ます。
see: PHP:token_get_all
1 2 3 4 5 6 7 8 9 10 11 12 13 | function decomment($sorce){
$out = '';
foreach(token_get_all($sorce) as $token){
if(is_array($token)){
if($token[0] != T_COMMENT){
$out .= $token[1];
}
}else{
$out .= $token;
}
}
return $out;
}
|


nobsun
#6534()
Rating-1/5=-0.20
[ reply ]