Re: [PHP] read file local not remote

2007-02-26 Thread Joker7
In news: [EMAIL PROTECTED], "Martin Zvarík" said: >> Difference: You don't call file as http://www.myweb.com/ but instead >> you use the path like c:\some.txt or ../some.txt etc. >> >> PHP 5 >> = >> echo file_get_contents("some.txt"); Works a treat Cheers Chris -- Cheap As Chips Bro

Re: [PHP] read file local not remote

2007-02-25 Thread Martin Zvarík
Difference: You don't call file as http://www.myweb.com/ but instead you use the path like c:\some.txt or ../some.txt etc. PHP 5 = echo file_get_contents("some.txt"); PHP 4 = $fp = fopen("some.txt", "r"); echo fread($fp, filesize ("some.txt")); fclose($fp); Another solution

Re: [PHP] Read file on file system

2007-02-04 Thread Richard Lynch
On Sun, February 4, 2007 7:47 am, Bagus Nugroho wrote: > If I have file on[windows] c:\test.csv. > How I can read the entire contents of this file? > > I have try file_get_contents, fgetcsv and etc but didn't work. > May I'm mis-understanding about using those function. Define "didn't work" Becau

Re: [PHP] Read file on file system

2007-02-04 Thread Satyam
file_get_contents takes a file name as an argument, not an opened file handle. - Original Message - From: "Bagus Nugroho" <[EMAIL PROTECTED]> To: "Stut" <[EMAIL PROTECTED]>; Sent: Sunday, February 04, 2007 3:45 PM Subject: RE: [PHP] Read file on f

Re: [PHP] Read file on file system

2007-02-04 Thread Stut
Stut wrote: $filenane = "d:\\test.csv Oops... $filename = "d:\\test.csv"; -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Read file on file system

2007-02-04 Thread Stut
Bagus Nugroho wrote: in simple like this $filename = "d:\\test.csv"; $openfile = fopen($filename,'r'); $readfile = fread($openfile,filesize($filename); echo $readfile or like this . echo file_get_contents($openfile); . echo fgetcsv($openfile); Try this... ...and not

RE: [PHP] Read file on file system

2007-02-04 Thread Bagus Nugroho
bn -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Sun 04-Feb-2007 21:14 To: Bagus Nugroho Cc: php-general@lists.php.net Subject: Re: [PHP] Read file on file system Bagus Nugroho wrote: > If I have file on[windows] c:\test.csv. > How I can read the entire contents of

Re: [PHP] Read file on file system

2007-02-04 Thread Satyam
Have you doubled the backslash to escape it? Or put it in between single quotes? Either: "c:\\test.csv" or 'c:\test.csv' or even 'c:/test.csv' Otherwise, a \t in between double quotes will be interpreted as a tab Satyam - Original Message - From: "Bagus Nugroho" <[EMAIL PROTECTED]

Re: [PHP] Read file on file system

2007-02-04 Thread Stut
Bagus Nugroho wrote: If I have file on[windows] c:\test.csv. How I can read the entire contents of this file? I have try file_get_contents, fgetcsv and etc but didn't work. May I'm mis-understanding about using those function. Well, from examining the code you included in your post, and readin

RE: [PHP] read file from specific line

2005-01-27 Thread Jay Blanchard
[snip] Is there any way reading a file from a specific line? (textfile) [/snip] Yes. Loop through a count until you reach the line you want, then read while(!feof($myFile)){ if("lineNumberIWant" >= $i){ read line $i++; } else {

Re: [PHP] Read file dates for most recent

2002-08-13 Thread Bas Jobsen
Op dinsdag 13 augustus 2002 23:25, schreef Mike Davis: > I need to read a directory full of PDF files, and get the file date of the > most recent. > Can someone get me started? $latime) { $lasttime=filemtime($file); $lastfile=$file; } } } echo $lastfile.'

RE: [PHP] read file

2001-11-23 Thread fitiux
Hi! you could use something like this..: $fp=fopen("pathto/".$filewithip,"r"); while ($line=fgets($fp,1024)) { echo "ip : ".$line; } fclose($fp); cheers, --Patricio - Original Message - From: PHP Newbie <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>

Re: [PHP] read file

2001-11-23 Thread Thomas Fischbach
hi, andrey hristov told me how to read a file and put it into a table (thx) but now i see that i need the data in an array. can somebody help me please? thx On Friday 23 November 2001 10:16, Andrey Hristov wrote: > $content = file('file_name.txt'); > $HTML .=''; > foreach ($content as $v){ >

Re: [PHP] read file

2001-11-23 Thread Alberto Mucignat
Il ven, 23 nov 2001, hai scritto: > hi, > andrey hristov told me how to read a file and put it into a table (thx) > but now i see that i need the data in an array. > can somebody help me please? just use the first line of Andrey: $content = file('file_name.txt'); file function reads entire file

Re: [PHP] read file

2001-11-23 Thread Andrey Hristov
$content = file('file_name.txt'); $HTML .=''; foreach ($content as $v){ $HTML .=''.$v.''; } $HTML .=''; echo $HTML; Regards Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: "PHP Newbie" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>