[PHP] Help with Strings Please

2004-08-31 Thread Nick Wilson
Hi, I have a string like this, read from an html file: ' VALUE=16' The value could be any number. I am trying to get that number. I have this so far, i was hoping someone might tell me how to get that number: ?php $handle = fopen(page.php, r); while (!feof($handle)) { $buffer .=

Re: [PHP] Help with Strings Please

2004-08-31 Thread Marek Kilimajer
Nick Wilson wrote: Hi, I have a string like this, read from an html file: ' VALUE=16' The value could be any number. I am trying to get that number. I have this so far, i was hoping someone might tell me how to get that number: ?php $handle = fopen(page.php, r); while (!feof($handle)) {

Re: [PHP] Help with Strings Please

2004-08-31 Thread Justin French
Nick, Nick wrote: I have a string like this, read from an html file: ' VALUE=16' The value could be any number. I am trying to get that number. If you have that exact string and you want to extract just the number, then a simple regex to delete all non-numeric characters should suffice. I have

Re: [PHP] Help with Strings Please

2004-08-31 Thread John Holmes
From: Marek Kilimajer [EMAIL PROTECTED] $handle = fopen(page.php, r); while (!feof($handle)) { $buffer .= fgets($handle, 4096); } fclose($handle); file_get_contents() could be helpful here, too... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Help with Strings Please

2004-08-31 Thread Nick Wilson
* and then Marek Kilimajer declared Im not very good at regex, is there an function that would help me? (couldnt see one...) preg_match('/value\s*=\s*([0-9]+)/i', $buffer, $result); print (Result:br /.$result[1]); Marek, you're a star ;-) I *hate* having to ask someone to do my