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! Quote Link to comment https://forums.phpfreaks.com/topic/305523-get-price-sum/ 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? Quote Link to comment https://forums.phpfreaks.com/topic/305523-get-price-sum/#findComment-1553298 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.