$data = "google,bing,searchengine,seo,search";
$exp = explode(",",$data);
$filtr = array("google","bing");
$fdat = str_replace($filtr,"",$data);
$clean = implode(",",$fdat);
echo $clean;
這給了放,,searchengine,seo,search
如何擺脫空白?
如何才能擺脫前兩個空白的逗號?
+1 ideone鏈接:http://ideone.com/c9J04 – 2011-01-29 15:56:00
哇真是異想天開太短 – 2011-01-29 16:03:45