You are here: Re: remove specific line « PHP Language « IT news, forums, messages
Re: remove specific line

Posted by Kimmo Laine on 06/18/05 16:01

"Ron Eggler" <NOspam@hotmail.com> kirjoitti
viestissδ:3higceFh4iriU1@individual.net...
> Kimmo Laine wrote:
> [snip]
>> Hmm file_put_contents is fairly new function, available since PHP5.
>> It is seems that you're running the script with older php.
> yup, php 4.3.3
>> Doesn't
>> matter, that's just a shortcut for:
>>
>> if(@$handler = fopen("emails.txt","w")){
>> foreach($emails as $line) fputs($handler, "$line\r\n", 512);
>> fclose($handler);
>> }
>
> But following function doesn't remove the passed string ($email_address)
> out of the textfile ($blacklist)


I'll just copy below, what I answered to you a couple of days ago, when you
were opening another file inside a function...

-------
$blacklist has not been defined, or it is outside the variablescope. I'm
guessing you've defined $blacklist elsewhere in the code. The easiest thing
to do is define $blacklist global. Just insert the line

global $blacklist;

at the first line of the funtion, before $file=fopen(.... That way the
function "sees" the variable as well, and therefore knows what to open.
-------

Honestly, Ron... I thought you got it the first time?

--
"I am pro death penalty. That way people learn
their lesson for the next time." -- Britney Spears

eternal.erectionN0@5P4Mgmail.com

 

Navigation:

[Reply to this 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

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