$ str = & lt& lt& lt結束
& lt李& gt?& lta href = " user/1232/177/201010405615065 . html " class = " R2 " target = " _ blank " title = "。初級職稱培訓班
& lt李& gt?& lta href = " user/1232/16/200912915154788014 . html " class = " R2 " target = " _ blank " title = " Hefei。初級考試必須掌握的數字
結束;
$ arr = explode(' & lt;/Li & gt;',$ str);
foreach($ arr as $ k = & gt;$v){
//因為
如果(!空($v)){
$ arr[$ k]= $ v . ' & lt;/Li & gt;';
}否則{
unset($ arr[$ k]);
}
}
print _ r($ arr);