note 90636 added to function.preg-replace
| From: | timgolding_10 at hotmail dot com | Date: | Fri, 01 May 2009 20:46:32 +0000 |
| Subject: | note 90636 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-154086@lists.php.net to get a copy of this message | ||
This is about the simplest example possible. If shows how to echo passwords safely
<?php
$password="secret";
$safe_pass=preg_replace("(.)", "*", $password);
echo $safe_pass;
?>
Having said that you passwords will probably be hashed so it's fairly pointless.
I just wanted to say a big thank you to arkani at iol dot pt your contribution was very helpful for
me.
----
Server IP: 92.48.74.199
Probable Submitter: 84.43.33.165
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- https://master.php.net/note/edit/90636
Del: integrated -- https://master.php.net/note/delete/90636/integrated
Del: useless -- https://master.php.net/note/delete/90636/useless
Del: bad code -- https://master.php.net/note/delete/90636/bad+code
Del: spam -- https://master.php.net/note/delete/90636/spam
Del: non-english -- https://master.php.net/note/delete/90636/non-english
Del: in docs -- https://master.php.net/note/delete/90636/in+docs
Del: other reasons-- https://master.php.net/note/delete/90636
Reject -- https://master.php.net/note/reject/90636
Search -- https://master.php.net/manage/user-notes.php