Re: fputs?

From: Date: Tue, 13 Mar 2001 22:48:06 +0000
Subject: Re: fputs?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43725@lists.php.net to get a copy of this message
figured it out just had to use fread first. $fpoint3 = fopen ($testshadow, "r+") or die("couldnt open shadow file again"); $contents = fread ($fpoint3, $shadowfilesize); fputs ($fpoint3, ereg_replace("$data[0]:$shadow[1]", "$data[0]:$data[1]", $contents)); tho i will say it was a pain in the ass to get it to work.. now i can delete all my echo lines so i could follow the script with stdout :} <-----CoreComm-Internet-Services---http://core.com-----> (Jon Marshall CoreComm Services Chicago) (jonathon.marshall@core.com Systems Engineer II) (enthalpy@core.com Network Operations) <-----Enthalpy.org-------------http://enthalpy.org-----> (enthalpy@enthalpy.org The World of Nothing) <------------------------------------------------------> On Tue, 13 Mar 2001, enthalpy wrote: > > can you use str_replace or ereg_replace in an fputs statement? > > something like this > > fputs("$fpoint2", "str_replace($oldcrypt, $newcrypt, $shadow[2])"); > > i need to replace a string in a file. the string is in an array tho.. is that why this isnt > working? > > <-----CoreComm-Internet-Services---http://core.com-----> > (Jon Marshall CoreComm Services Chicago) > (jonathon.marshall@core.com Systems Engineer II) > (enthalpy@core.com Network Operations) > <-----Enthalpy.org-------------http://enthalpy.org-----> > (enthalpy@enthalpy.org The World of Nothing) > <------------------------------------------------------> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#43725) next »