Jump to content

Archived

This topic is now archived and is closed to further replies.

oli_62

replacement within a string

Recommended Posts

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

Share this post


Link to post
Share on other sites
you'd use regex for that...

and if you use fgets you'd run a loop
regexing each line, each iteration

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.