I’m trying to use preg_match on a users address input and no matter what I try they are all wrong, and I must have tried 50 different ways. I’m hoping someone can help me out.
I simply want to include numbers and letters, apostrophe, space, period, and hyphen. Below is the latest rendition of what I have tried.
$address = "55 My'Road-West Ave.";
if (!preg_match('/^[a-z0-9 :,.!().?";\'-]+$/i', $address)) { $error['address'] = 1; }
Thanks