开发者

delete unknown characters from my form data?

开发者 https://www.devze.com 2023-04-02 04:53 出处:网络
I want function Delete all this characters from my forms 开发者_JAVA百科!@#$%^&*()-_+~`\'\";\\|][/.,~

I want function

Delete all this characters from my forms

开发者_JAVA百科
!@#$%^&*()-_+~`'";\|][/.,~

Only accept English characters linke (abcdefgh ....)

to use it in my registration form


$text = "something$^£^£$&£";
$text= preg_replace('/[^\w\d_ -]/si', '', $text);
echo $text; // output something


Have a look at inbuilt PHP functions :

http://www.php.net/manual/en/function.filter-input.php


You can use :jQuery plugin: Validation.

It's powerful

0

精彩评论

暂无评论...
验证码 换一张
取 消