note 94991 added to control-structures.for
| From: | amigojapan at osu1 dot php dot net | Date: | Mon, 07 Dec 2009 13:23:38 +0000 |
| Subject: | note 94991 added to control-structures.for | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163636@lists.php.net to get a copy of this message | ||
I made this script to validate international phone numbers, the scripts I found here are all for US
phone numbers, so I don't think they are good for me...
<?php
$phone="+81 (123) 456-7890";//Legal international phone number
$phone="+81 (123) 456-7890A";//Illegal international phone number
for($i=0;$i<=strlen($phone)-1;$i++) {
$char=$phone[$i];
if(!ereg("[+ ()0-9-]", $char)) die("illegal character " . $char);
}
?>
----
Server IP: 61.195.146.164
Probable Submitter: 114.48.108.110
----
Manual Page -- http://www.php.net/manual/en/control-structures.for.php
Edit -- https://master.php.net/note/edit/94991
Del: integrated -- https://master.php.net/note/delete/94991/integrated
Del: useless -- https://master.php.net/note/delete/94991/useless
Del: bad code -- https://master.php.net/note/delete/94991/bad+code
Del: spam -- https://master.php.net/note/delete/94991/spam
Del: non-english -- https://master.php.net/note/delete/94991/non-english
Del: in docs -- https://master.php.net/note/delete/94991/in+docs
Del: other reasons-- https://master.php.net/note/delete/94991
Reject -- https://master.php.net/note/reject/94991
Search -- https://master.php.net/manage/user-notes.php