2011-08-22 113 views

回答

3

我認爲,爲了清晰起見,您可能希望將字符串分解爲數組,然後刪除不需要的元素,然後重新構建字符串。像這樣:

$keywords = 'tech,sms,libya,tax';  // Set String 
$keywords = explode(',', $keywords); // Explode into array 
unset($keywords[ array_search('libya', $keywords) ]); // Unset the array element with value of 'libya' 
$keywords = implode(',',$keywords);  // Reconstruct string 
+0

是的,這是有道理的 – MrFoh