I have this DOM in my site:
$question_data = '<p>Gambar di bawah menunjukkan ciri-ciri haiwan berikut:</p>
<p><img src="/uploads/images/questions/96_20160303124007.PNG" /></p>
<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;">
<tbody>
<tr>
<td style="text-align: center;">Beranak</td>
<td>
<p style="text-align: center;">Bertelur</p>
</td>
</tr>
</tbody>
</table>
<p>##a</p>';
This my REGEX to filter 96_20160303124007.PNG
:
define('GET_IMAGE_NAME_WITH_EXTENSION_PATTERN','/<img .*?src=(?:['\"])[^\"]*\/\K(.*?\.(?:jpeg|jpg|bmp|gif|png))(?:['\"]).*?>/');
$pattern = GET_IMAGE_NAME_WITH_EXTENSION_PATTERN;
$arr_image_file_names = array();
preg_match_all($pattern, $question_data, $arr_image_file_names);
But got no output... anyone knows how to solve this?