Your close. Let me give you a detailed example:
<?php
function callback($buffer)
{
// Here's where the email's will be replaced
}
ob_start('callback');
?>
<html>
<title>Test</title>
<meta name="reply-to" content="webmaster@domain.com">
<body>
.... Text Text
<a href="mailto:me@domain.com">me@domain.com</a>
.... More Text me@domain.com Text Text...
</body>
</html>
<?php ob_end_flush(); ?>
I'll be buffering the output then when I flush it the callback function goes through the buffer and replaces certain emails. If it's in the anchor tag it'll be replaced with "javascript:getEmail(user,domain);". With the above example, <a href="mailto:me@domain.com">, mailto:me@domain.com will be replaced with javascript:getEmail('me','domain.com'). If the email is between tags, like between > and <, then it will be replaced with <script>showEmail(user,domain);</script> Using the above example, me@domain.com (between the anchor tags and below that) will be replaced with <script>showEmail('me','domain.com');</script>. Note that the the email between tags might not be DIRECTLY between tags (and not anchor tags specificly), there could be other text in their. Now, the email in the meta tag will not be touched. Thanks for your help!