Finding digits in variable containing text, and IDing them


Posted on 16th Feb 2014 07:03 pm by admin

$romanstock = "http://www.remoteprice.com/data.asp?storeid=123&itemcode=456&type=2";$contentsstock = file_get_contents($romanstock);
The above code, when rendering $contentsstock, renders this:
Quote:var cText = '13' document.write(cText)

Did you know?Explore Trending and Topic pages for more stories like this.
'13' could be 1 or even 189.

I need to get those digits out of there, and then query them, ie;
Line number On/Off | Expand/Contractif ($contentsstock >= "2") { echo "this is 2";}

I think I know how to strip out characters from character 10 (for example) up to character 12, but this quote could be 1, 2 or 3 digits.

Can anyone help me here please?
No comments posted yet

Your Answer:

Login to answer
51 Like 10 Dislike
Previous forums Next forums
Other forums

Alternate messaging
I have 4 strings in MySQL db1

$string1 : Hello
$string2 : Hi
$string3 : Great
$strin

Echo Tweaking help!
HI. I would like to have the output of the entered variables repeat forever, but it's stopping at th

IP Based Cron Jobs
I run cronjobs on my website. After one of my visitors got curious and tinkered around he realized h

convert PHP array to Javascript array
I have a page that gets a request sent from AJAX, and I am trying to convert a PHP array to a javasc

Blogging s/w
heya frndz!!! i want to start a blog.... m looking for a s/w like oscommerce which is thr for e-comm

Inserting the current date/time while submitting the forum
What do I need to add below to update the current date/time? I have a field in the database called d

Time script, set to my time zone?
I am using this line to get the date and time

Code: $time = date(F." ".d.", &q

Else statement screws up all css
Does anyone know what goes wrong in the process with this php code?
This code seems to be causing

Taking an HTML form and a PHP program and making it into one working file.
Hello,

So I would like to display everything INSIDE a specific directory. In other words, I

Anti Spam Code
Ok where do i start? Probably by telling you I have very little working knowledge of PHP and that I

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash