开发者

delete unknown characters from my form data?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜