Jump to content

preg_replace password


hhawkins

Recommended Posts

I have this -

$var = preg_replace("/[^A-Za-z0-9_, -]/", "", $var);

 

But I want to add special characters to be allowed, is it as simple as /W?

 

Or do I need to just add them individually?

$var = preg_replace("/[^A-Za-z0-9_$!#, -]/", "", $var);

 

This is feeding into a sql database should I not allow the use of / or \.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/76091-preg_replace-password/
Share on other sites

Archived

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

×
×
  • Create New...

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.