<?php $phone = Phone number; if ($phone == "805" . WILDCARD HERE) { DO SOMETHING; } else { DO SOMETHING ELSE; }?>
if (strpos($phone, '805') != FALSE){} else {}
if ($phone == "805" . *)
if ((substr($phone, 0, 3) == "805") ...
<?php $phone = Phone number; if (strncmp("805", $phone, 2) == "0") { DO SOMETHING } else { DO SOMETHING ELSE }?>
Quick question:
I want to add a wild card in a script I'm writing. Here's an example:
I'm very new to PHP and tried looking up a wildcard via google, but to no avail.
Can anyone help me out?
Thnx!
So the code would be
I want to check if someone's number starts with 805. Any number after that is irrelevant. It's the area code I'm interested in. I can't have it return false.
Maybe something like this?
this doesn't work :/
or look at substr_compare().
This worked like a charm