Sorry - didn't mean to sound blunt (not having a great day!).
I have tried putting the $variable in, but I had errors asking for ; or ,
I think the '\ and /' was causing problems. How should I be writing this?
I can see how preg_match should work. It looks in the result for a string, 0-9 stating it to be numeric, and then returns that match to an output variable. Just cannot see how to make it work with a variable without the errors.
Code: Select all
$romanstock = "http://www.remoteprice.com/data.asp?storeid=123&itemcode=456&type=2";
$contentsstock = file_get_contents($romanstock);
preg_match($contentsstock([0-9]+)\'/', $str, $matches);
print_r($matches);
produces...
Parse error: parse error, expecting `')'' in C:\xampp\phpmyadmin\site\includes\product.inc on line 127
Line 127 is
Code: Select all
preg_match($contentsstock([0-9]+)\'/', $str, $matches);