NYCPHP Meetup

NYPHP.org

Help trying to put email address into filename

soazine@pop.erols.com soazine at pop.mail.rcn.net
Wed Jun 11 19:19:53 EDT 2003


Weird but necessary request.. I have to put an email address into a
filename.  Here is my code that I THOUGHT would do so:

foreach (array('.', '_') as $key => $val) {
    $safeEmail = preg_replace("/\\\\$val/e", '%' . ord($val), $email); // YOU
HAVE TO REPLACE . AND _ WITH ASCII NUMBERS
}

This, however, breaks nastily:

Parse error: parse error in /users/ppowell/web/repository.php(89) : regexp
code on line 1

Fatal error: Failed evaluating code: @m° in
/users/ppowell/web/repository.php on line 89

Any ideas, anyone? 

Thanx
Phil

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .






More information about the talk mailing list