<?php
$values = '1-222-333-4545';
if (strlen($values) > 0 && !preg_match('/^[0-9]{3}-[0-9]{3,4}-[0-9]{3,4}$/', $values)) {
$err_msg[4] = ('Phone number must be in format xxx-nnnn-nnnn.');
echo $err_msg[4];
}
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Phone number must be in format xxx-nnnn-nnnn.