Page 1 of 1

How do I use Preg_match to query the value, alpha/num?

Posted: Wed Nov 05, 2014 3:53 am
by simonmlewis

Code: Select all

      $romanstock = "http://www.remoteprice.com/data.asp?storeid=*****&itemcode=$row->romancode&type=2";
      $contentsstock = file_get_contents($romanstock);
      preg_match('/var cText = \'([0-9]+)\'/', $contentsstock, $matches);
This code queries a URL and then comes back to say what numeric value is found.
But now the company that provides it, occasionally has the word "multi" in there.

So I need to query it into $matches, and just see whatever the hell is in there - whether it is 1, 2, 3.... multi... fred?!

How do I do that?