oli_62 Posted May 1, 2006 Share Posted May 1, 2006 Hello I have a guestbook with a .txt file as guestbook entry storage. Now I want make a spam protection and therefore I want replace the E-Mail address in the output.My .txt file has the following syntax:[code]<b>Datum:</b> Sun 04/30/06 8:56PM<br><b>Von:</b> admin<br><b>Email: </b><a href=mailto:[email protected]>[email protected]</a><br><br><b>Eintrag:</b>[/code]Now I want replace the following section within the string:<a href=mailto:[email protected]>[email protected]</a><a href=mailto:%</a>[code]$buffer = fgets($fd, 4096);$lines[] = $buffer;[/code]Thanks for help!oli Link to comment https://forums.phpfreaks.com/topic/8837-replacement-within-a-string/ Share on other sites More sharing options...
Zane Posted May 1, 2006 Share Posted May 1, 2006 you'd use regex for that...and if you use fgets you'd run a loopregexing each line, each iteration Link to comment https://forums.phpfreaks.com/topic/8837-replacement-within-a-string/#findComment-32441 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.