I am trying to create a php script that will retrieve the WOW factor numbers (right hand side) from this webpage http://forums.moneysavingexpert.com/forumdisplay.php?f=36 and store them in variables/array.
I have looked in the source code for the page and the values (ints) appear after this code "<div style="padding: 12px 0px 0px 0px;"><strong>
"
I am trying to use preg_match currently just to retrieve 1 value (before I move onto retrieving multiple values), however I am having no luck. When I perform a var_dump there is nothing stored in my array. Also - I am not sure whether or not to escape the "s in the string above. If I do then var_dump prints out
array(0) { }
If I don't then var_dump prints out
NULL
The code I am using is below:
<html>
<head>
<title>
MSE Value Extractor
</title>
</head>
<body>
<?php
echo "Welcome to MSE deal finder!\n";
$content = file_get_contents('http://forums.moneysavingexpert.com/forumdisplay.php?f=36');
preg_match('/<div style=\"padding: 12px 0px 0px 0px;\"><strong>(.)</', $content, $match);
var_dump($match);
$value = $match[1];
echo "Value obtained is $value \n";
?>
</body>
</html>
If anyone could comment on where I am going wrong, it would be hugely appreciated. I'm not that familiar with php.
Thanks in advance