RE: [PHP] File reading code2

2007-01-06 Thread Peter Lauri
This just dumps the content to the browsers. You could use file() instead if you want to loop thru every line. $file = "test1.txt"; if(file_exists($file)) { if(is_readable($file)) { if($file_content = get_file_contents($file)) { echo "";

Re: [PHP] file reading and regex

2003-06-04 Thread Michael Allan
Marek, Your pattern should look like: $pattern = "([[:digit:]]{6}0425\.jpg)"; BINGO! This will give you the image name, but remember that ereg works on single lines and also the image might be taken at some time around 4:25. So you need a while loop to read the html line by line, in the loop t

Re: [PHP] file reading and regex

2003-06-04 Thread Marek Kilimajer
Your pattern should look like: $pattern = "([[:digit:]]{6}0425\.jpg)"; This will give you the image name, but remember that ereg works on single lines and also the image might be taken at some time around 4:25. So you need a while loop to read the html line by line, in the loop try to match the

RE: [PHP] file reading and regex

2003-06-04 Thread Jay Blanchard
[snip] http://rsd.gsfc.nasa.gov/goesg/earth/Weather/GMS-5/jpg/vis/4km/";; if (!($fp = fopen($URLbase, "r"))) { echo "Could not open the url"; exit; } $contents = fread($fp, 100); fclose($fp); ?> [/snip] Was that r

RE: [PHP] file reading

2002-08-27 Thread Brad Dameron
'w+' - Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. Change it to "r" since you are only reading. Also check to make sure your pathing is correct. --- Brad Dameron

Re: [PHP] File reading help with Syntax

2002-07-17 Thread Analysis & Solutions
On Wed, Jul 17, 2002 at 10:00:29AM -0400, Chris Crane wrote: > I am getting data froma website for stock information. If I type in the > brower the URL I get a text file display list this; > > Date,Open,High,Low,Close,Volume > 16-Jul-02,7.92,8.10,7.68,7.82,605500 > 15-Jul-02,7.98,8.02,7.59,8.02,5

Re: [PHP] file reading and array's

2002-02-16 Thread Scott
Perfect! Thank you, my mind was out in left field somewhere. On Tue, 12 Feb 2002, DL Neil wrote: > Hi Scott, > > > In my constant effort to improve my perl conversion project, I have a > > question regarding file reading. I am taking two files and combining > > them in an array and then writ

Re: [PHP] file reading and array's

2002-02-12 Thread DL Neil
Hi Scott, > In my constant effort to improve my perl conversion project, I have a > question regarding file reading. I am taking two files and combining > them in an array and then writing out a new file. Is there a way to: > a)strip out the first line of the second file > b)test for conditions

Re: [PHP] file reading and textarea problem

2001-10-03 Thread Mukul Sabharwal
Hi, fopen let's you read the whole file. Try this tutorials on files for a more hands on approach : http://www.paphe.com/php/tutorials/111000.php = * Know more about me: http://www.geocities.com/mimodit * _

RE: [PHP] file reading and textarea problem

2001-10-03 Thread Maxim Maletsky \(PHPBeginner.com\)
Yup. fread() Read on PHP.net/fread PHP.net/fgets ...to learn how to manipulate files. Maxim Maletsky www.PHPBeginner.com -Original Message- From: Nikola Veber [mailto:[EMAIL PROTECTED]] Sent: mercoledi 3 ottobre 2001 11.11 To: php forum Subject: [PHP] file reading and textarea

Re: [PHP] file reading and textarea problem

2001-10-03 Thread Philip Olson
If you use fgets(), you can loop through it like the example does : http://www.php.net/fgets Or, consider the file() function which automagically assigns each line to an element of the array. http://www.php.net/file Or, you could open the file as a one string using fread(), see the exampl