html+php: how to check whether a string contains letters (from ANY

NumNoum

New member
alphabet) and numbers and spaces only? html+php: how to check whether a string contains letters (from ANY alphabet, not just A-Za-z) and numbers and spaces and dashes and commas and . only. I'm talking about using of a preg_match function. I've heard something about \w\s or something like that to validate all letters from all alphabets but I had no luck how to use it.

For example, such strings are valid:
$str1="hello"; //valid
$str2="hello hello 123"; //valid
$str3="zurück, öü12,,,,345 ??Ž wiadomo??."; //valid

Thank you.
 
Back
Top