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 pre;
[snip]
?php
$URLbase =
http://rsd.gsfc.nasa.gov/goesg/earth/Weather/GMS-5/jpg/vis/4km/;;
if (!($fp = fopen($URLbase, r)))
{
echo p style=color:whiteCould not open the url/p;
exit;
}
$contents = fread($fp, 100);
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
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
'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
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,577200
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 writing out
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
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
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
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
*
11 matches
Mail list logo