$myVariable1 = "[COLOR="#FF0000"][SIZE=5]([/SIZE][/COLOR]";
$myVariable2 = "a3bc123";
$myVariable3 = "ze3[COLOR="#FF0000"][SIZE=5]>[/SIZE][/COLOR]1fg";
$myVariable4 = "35[COLOR="#FF0000"][SIZE=5]%[/SIZE][/COLOR]cd[COLOR="#FF0000"][SIZE=5]:[/SIZE][/COLOR]";
In case of myVariable1, it has a special character only, i.e. (.
In case of myVariable2, it has no special characters.
In case of myVariable3, it has a special character, i.e. >.
In case of myVariable4, it has some special characters, i.e. % and :.
I like to make a condition about myVariables has any special characters, i.e. SIZE=5[/SIZE],$,>,>,:,;,,,%,/.
if ( $myVariables has any special characters )
{ echo "yes"; }
else
{ echo "no;}
In case of myVariable1, myVariable3, and myVariable4, it says “yes”.
and In case of myVariable2, it says “no”.
How can I check myVariables has special characters or not?