RegEx problems...

From: Date: Mon, 03 Jun 2002 17:15:15 +0000
Subject: RegEx problems...
Groups: php.general 
Request: Send a blank email to php-general+get-100435@lists.php.net to get a copy of this message
This is baffling me, I have a form on one page that opens a php file in a text area for editing. In order to view the contents of the file in the text area I had to setup a eregi_replace("<","&a&") string. When I save the changes back to the text file I setup a reverse string i.e. [ eregi_replace("&a&","<") ] however it just blows right by this portion of the script. I have tried a few different variations ex. $file_name= "blank.php"; $file_open = fopen($file_name, "wr+"); $replace = eregi_replace("&a&","<", $passwords); fwrite($replace, $file_open, stripslashes($passwords)); print ("$passwords was written to $file_name"); and $file_name= "blank.php"; $file_open = fopen($file_name, "wr+"); fwrite(eregi_replace("&a&","<"), $file_open, stripslashes($passwords)); print ("$passwords was written to $file_name"); So far nothing has worked, actually the last example overwrites the file with nothing. Anyone come across a problem similar to this? If so how did you solve it? Thanks in advance, Jas

« previous php.general (#100435) next »