0
$item->description = preg_replace("/\<center\>\<a href=\"(.*)\"\>\<img alt=\"\" src=\"(.*)\" \/\>\<\/a\>\<\/center\>/", "$2", $item->description);
但我需要把結果$2
字符串$item->image
。
如何做到這一點?preg_replace,如何設置字符串
否定的,那麼$用品 - >圖像將與所有的內容,其中有$用品 - >描述。 – Berny
不,我需要解析XML和$ item-> description有html代碼,我想清除它。順便說一句,這個腳本將在每小時工作。 – Berny
所以你的'$ item-> image'應該怎麼樣? *您*表示應將'$ 2'分配給'$ item->圖片'。 – jan267