Miscellany
public php v1 · immutable$allowableExtensions = array('jpg', 'jpeg', 'bmp', 'gif');$extensionsRegexp = '(?:' . implode('|', $allowableExtensions) . ');if (preg_match_all('/(?:src|href)\s*=\s*(?:\"(.*?\.' . $extensionsRegexp. ')\"|\'(.*?\.' . $extensionsRegexp . ')\'|([^\'\"\> ]*\.' .$extensionsRegexp . '))/Usi', $buffer, $matches)) { foreach ($matches[1] as $url) { $things[$url]=1; }}