Reply to Re: remove specific line

Your name:

Reply:


Posted by Ron Eggler @ work on 06/17/05 16:26

Ron Eggler @ work wrote:
> Kimmo Laine wrote:
>> "Ron Eggler @ work" <nospam@hotmail.com> kirjoitti
>> viestissδ:3hcgm7Fga8fmU1@individual.net...
>>> Hi,
>>>
>>> I got a textfile with e-mail addresses on every line. now I want to
>>> be able
>>> to delete one e-mail-address from this file and shift everything
>>> below one line up. how do I do that?
>>> Thank you! :)
>>
>> <?php
>> // Read the file into an array. One address per row
>> $emails = file("emails.txt");
>> // Remove given email address
>> unset($emails[array_search($email_address)]);
>> // Change array back to end-of-line separated string, write to file
>> file_put_contents("emails.txt", implode("\r\n", $emails));
>> // In, out, wipe the tool, say "thank you", and leave. Simple and
>> easy.
>
> Oh thank you very much! :)
> But I get these Messages:
>
> Warning: Wrong parameter count for array_search() in
> /srv/www/htdocs/web2/html/php/nospam/pop.php on line 31
>
> Fatal error: Call to undefined function: file_put_contents() in
> /srv/www/htdocs/web2/html/php/nospam/pop.php on line 33

ah: php_info() says:
PHP Version 4.3.3
and file_put_contents() need php5. how to do it with php 4.3.3?
Thank you! :)

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация