<?php $str = "This is one string with this picture pic1.jpg and here there's another one pic2.png for example"; $pat = '/\w+\d\.[a-zA-Z]{3}/'; $arrImg = null; if (preg_match_all( $pat, $str, $matches, PREG_PATTERN_ORDER )) { $arrImg = array_pop($matches); print_r($arrImg); } else { echo "no matches"; }
You have javascript disabled. You will not be able to edit any code.