The values will be in this format 123-123-123-12345 that I would like the preg_match to work for. Can you see anything wrong with this regEx?
foreach($elem as $key=>$value) {
// Have tried this With and without the + before the $ as well
if(preg_match("/^[0-9]{3}\-[0-9]{3}\-[0-9]{3}\-[0-9]{5}+$/", $value)) {
echo "Yeah match Elm: ".$value."<br />";
} else {
echo "Boo Hoo Elm: '".$value."'<br />";
}
}
have also tried
/^\d{3}\-\d{3}\-\d{3}\-\d{5}+$/
//With and without the + before the $
They all fail with Boo Hoo ;(
EDIT:
var_dump($elem)
array(3) { [0]=> string(1) "c" [1]=> string(0) "" [2]=> string(36) "123-123-123-12345" }