I'm having a little trouble with preg_match(). It's been quite some time since I've last used it. I've looked at the manual and googled it a bit, but I can't quite seem to find what I'm looking for.
The problem is this:
I'm calling an amazon page, and then trying to look up the price of the item displayed on the page.
<?php
$handle = 'http://www.amazon.com/exec/obidos/tg/detail/-/B0001DI6FM/qid%3D1099160907/sr%3D1-3/ref%3Dsr%5F1%5F3/002-5300324-7261602?v=glance&s=videogames';
$html = file_get_contents($handle, 1056784);
preg_match_all('/<b class="price">\n$(.*)/U', $html, $match) or die('error');
print_r($match[0]);
When I use the above it will return "error".. If I chance it to just "/<b class="price">(.*)/U"
it returns
Array
(
[0] => <b class="price">
)
The code on the page that I'm looking to match is:
<b class="price">
$45.95
</b>
Any suggestions?