I need to write a php preg_match to identify a price between some tags in a bit of html I have stored in a variable:
<span class="price-ld">250</span>
I tried writing it like this, but it keeps giving me errors:
preg_match('/<span class="price-ld">(.*)/i', $candidate[0], $price);
I am very new to php and all these delimeters is very heavy to me. I would really appreciate some help from you pros – probably very easy to you!
First of all – http://php.net/manual/en/function.preg-match.php – read it, please.
Then you see that /(.*)/i matches a whole string.
Please, give here your piece of html (it’s needed to know the price wrapping tags).