Extract images from HTML

Returns a list of all images (src values) in HTML.

php
fork add to bundle source
function extract_html_images($html) { preg_match_all('/<img[^>]+src=["\']([^"\']+)["\']/misu', $html, $matches); return $matches ? $matches[1] : null; }

usage

load_function('extract_html_images'); $html = '<img src="/1.jpg"/> ... <img src="/2.jpg"/>'; $list = extract_html_images($html); print_r($list); // Array // ( // [0] => /1.jpg // [1] => /2.jpg // )
← how to use this in app?
create log ...inout