Code:/*** @desc: Regular Match class * @author [Lee] <[<[email protected]>]>* @method * 1, Geturl get all Hyperlinks * 2, getimg Get all pictures * 3, Getaudio get all audio files * 4, Getvideo get all video files * 5, getparagraph get all paragraphs * 6, GetUser Get custom content Preg custom regular, such as:/
Test:$match = new match($str);$ret = $match->getimg();var_dump($ret);
Output:array(7) {[0]=>string(61) "https://assets-cdn.github.com/images/search-shortcut-hint.svg"[1]=>string(69) "https://assets-cdn.github.com/images/spinners/octocat-spinner-128.gif"[2]=>string(75) "https://assets-cdn.github.com/images/spinners/octocat-spinner-32-EAF2F5.gif"[3]=>string(68) "https://assets-cdn.github.com/images/spinners/octocat-spinner-32.gif"[14]=>string(45) "https://badges.gitter.im/walkor/Workerman.svg"[15]=>string(48) "http://www.workerman.net/img/workerman-start.png"[16]=>string(42) "http://donate.workerman.net/img/donate.png"}
PHP Regular Match class