Quote:
Originally Posted by firepages
good point, ok thinking about it regex is probs the way to go
PHP Code:
$str='0337890- h 345645';
$str = preg_replace("/\D/","",$str);
if($str[0]=='0' && strlen($str)==13){
echo 'ok';
}
|
I'll have a play around with that code and read up on
preg_replace(). Regular Expressions are complicated to understand. Tried using an example code someone gave the other day so thought I'd read up on it.
Can't find any good documentation anywhere for detailed explanations etc.
Kind regards,
Lc.