* and then John Holmes declared
> >Whats the easiest/best way to do that with php?
> >just replace the line with ''?
>
> Yes, basically. You have to read the file, replace the part you don't want
> with an empty string and then re-write the file. If the file is small and
> you're using file
From: "Nick Wilson" <[EMAIL PROTECTED]>
Whats the easiest/best way to do that with php?
just replace the line with ''?
Yes, basically. You have to read the file, replace the part you don't want
with an empty string and then re-write the file. If the file is small and
you're using file() to read i
Hi,
some function with whihc you can do this
file();
foreach();
zareef ahmed
--- Nick Wilson <[EMAIL PROTECTED]> wrote:
> Whats the easiest/best way to do that with php?
> just replace the line with ''?
> --
> Nick W
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe
Whats the easiest/best way to do that with php?
just replace the line with ''?
--
Nick W
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I've been looking and haven't found anything on this. How do you open a file
then select a line and delete that line?
Thanks,
Rod
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> I've been looking and haven't found anything on this. How do you open a file
> then select a line and delete that line?
Warning: untested. This is just to give you a general idea.
$fileName = "blah.txt";
$lineToDelete = "Delete this line";
$fileArray = file( $fileName );
if(( $lineNum = arra
If your file isn't too large then you can use:
$lineArray = file( $pathToYourFile );
unset( $lineArray[$lineNum - 1] );
if( ($fl = fopen( $pathToYourFile, "w+" )) !== false )
{
foreach( $lineArray as $line )
{
fputs( $fl, $line );
}
fcl
7 matches
Mail list logo