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:admin@domain.tld>admin@domain.tld</a><br><br><b>Eintrag:</b>[/code]Now I want replace the following section within the string:<a href=mailto:admin@domain.tld>admin@domain.tld</a><a href=mailto:%</a>[code]$buffer = fgets($fd, 4096);$lines[] = $buffer;[/code]Thanks for help!oli Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/8837-replacement-within-a-string/#findComment-32441 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.