What is the proper preg_match syntax: 1. to test if there are only numbers (0-9) in a string? 2. to test if there are only a-z and A-Z letters in a string?
Thanks.
preg_match ("/[0-9]+$/", $string) this will match any string containing only chars 0-9
preg_match ("/[a-zA-z]+$/", $string) this will match any string containing only chars a-z or A-Z
Hope this helps 😉