There are a few problems with your preg_match line:
- Your pattern is not delimited, you need to surround to start and end with a delimeter such as / or ~, e.g.
- Square brackets define a class of character you are looking for, so
^(.*)$looks for a string starting with a 9, or a 6, or a 6, followed by any number of other characters.
- You aren't looking for 05 at all. One possible pattern for your rule would be
Since what you are looking for is quite simple, it might be more efficient to use a PHP string comparison function to check what's at the start, like
strpos('966', $data['phone']) !== 0 && strpos('05', $data['phone']) !== 0