mstdmstdd Posted November 2, 2017 Share Posted November 2, 2017 Hello, I tried to get 1st price : $html= 'New (1) from $799.99 + $14.99 shipping'; $pattern = '~ (?:.*) [\s]*from[\s]* (?<price>[\d\.\$]*) (?:.*) ~isUx'; $ret = preg_match(($pattern), $html, $imagesArrayText); echo '<pre>$imagesArrayText::'.print_r($imagesArrayText,true).'</pre>'; echo '<pre>$ret::'.print_r($ret,true).'</pre>'; But price is empty. why? Thanks! Link to comment Share on other sites More sharing options...
requinix Posted November 2, 2017 Share Posted November 2, 2017 Do you know what the /U flag does? While I'm at it, how about /i and /s? Are you tossing flags in there without knowing what they're doing? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.