I have no. of strings and i want to identify those string which have special characters.
I am trying this to do above
if (!preg_match('/[^A-Za-z0-9]/', $url)) {
echo "special character";
}
And I have also tried:
if (ctype_alnum($url)) {
echo "special character";
}
The character i want to allow are a-z, A-Z, 0-9,_,-,/
And my string containing special character is like
torbjörn-hallber etc.
how can i do that ? please help.