Okay, I am trying to check a $var for numbers, anywhere in the $var
What I have is
if(($number != 0) && (preg_match('/[0-9]{'.$number.'}/', $var) == 0))
{
// throw error
}
Where $number is a user defined quantity of numbers that must be in the $var.. unfortunately this preg_match only checks for side by side, but it could be anywhere in the $var
eg:
$var = 'fa5ba5rwbv';
$number = 2;
this should pass, but doesn't with my expression... but I can't find an example matching my specific need... can anyone help here?