Jump to content

Stripping


master82

Recommended Posts

I have a small mail system for my site, however I need to sanatise any use input...

 

I an familiar with:

 

<?php
$output = preg_replace("/[^a-zA-Z0-9s]/", "", $input);
?>

 

to restrict the input to text and numbers only, however, I need to also allow spaces, dots and commers. So could somebody help me add these into this?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/54467-stripping/
Share on other sites

Thats the exact website I got the code above from a few months ago, but it doesnt say anything about keeping spaces, commers, fullstops, and i guess even brackets in the variable. (at least not what I can find)

 

And all the google searches I have come accross always use date examples which also doesnt help :(

Link to comment
https://forums.phpfreaks.com/topic/54467-stripping/#findComment-269419
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.