extract img tag from a html code string through preg_match_all PHP function
问题 I've some html code and extracted the img src attribute from it. Into the html string there are some img like this: <img src="http://www.pecso.it/wp-content/uploads/2016/12/10_WRAS.png"> I've tried to do this with the following PHP code: $description = wpautop($this->data->description); $description = preg_replace("/\[[^\]]+\]/", '', $description); if (preg_match_all("<img src=(.*?)>", $description, $match)) { echo match; }; and the result is NULL. Can you help me, please? 回答1: Do not use