Thread
:
String management. Special chars!
View Single Post
pradeep
Team Leader
30Oct2006,11:23
You have to use Regular Expressions (regex) to filter out bad characters.Checkout the exmaple below.
Code: PHP
$string
=
"Asdsd - sdsd "
;
if
(
!
preg_match
(
"/^[
\w
]+$/"
,
$string
)
)
{
print
(
"Bad characters found!"
)
;
}