i am reading the php manual but what are all those characters for?
ex:
$msg = preg_replace("/[^A-z0-9]/"," ",$msg);
what does the / [ ^ mean??
here is another one:
function checkPhone($number)
{
if(preg_match('^[0-9]{3}+-[0-9]{3}+-[0-9]{4}^', $number)){
return $number;
} else {
$items = Array('/\ /', '/\+/', '/\-/', '/\./', '/\,/', '/\(/', '/\)/', '/[a-zA-Z]/');
$clean = preg_replace($items, '', $number);
return substr($clean, 0, 3).'-'.substr($clean, 3, 3).'-'.substr($clean, 6, 4);
}
}
what on earth does
$items = Array('/\ /', '/\+/', '/\-/', '/\./', '/\,/', '/\(/', '/\)/', '/[a-zA-Z]/');
mean??
and the { + - in preg_match('[0-9]{3}+-[0-9]{3}+-[0-9]{4}
thank you