Tris wrote: > the inout shoud be: > 2 x letters > 5 x numbers > eg: fr23454 / kr55555 / AP84754 This is a perfect example of a scenario where a single regular expression can replace a whole lot of code. E.g.: $pattern = "/^[a-zA-Z]{2}[0-9]{5}$/"; return preg_match( $pattern, $subject ); -- http://www.hyperlinkage.com/