Page 1 of 1

preg_replace question...

Posted: Thu Nov 12, 2009 7:53 am
by Wolf_22
Here's the code:

Code: Select all

<?php
    $exp = "/[0-9]{9}/";
    $rep = '__________';
    $file = file_get_contents('names.txt');
    $final = preg_replace($exp,$rep,$file);
    print_r($final);
?>
For the most part, I THINK it's working but the email addresses won't show at the end due to something (not being escaped?).

I was wondering if someone could explain why they're hidden? It's driving me bonkers. :)

Edit: Sorry, I'm awake now and realized how more information could be used (thank God for coffee). The "names.txt" has email addresses in it and in Firefox, the email addresses are hidden from the page. If "View Source" is done, they're there. What's up with this? Is this an issue with Firefox / browser-in-general?

Re: preg_replace question...

Posted: Thu Nov 12, 2009 5:39 pm
by Wolf_22
Okay, so I guess I'm an idiot. :) I simply did a preg_replace to remove both angle brackets on each end of the e-mail address(es). Doing so caused Firefox to stop recognizing them--which exposed them for the end-user. That's a first for me. :banghead: