WampServer
Apache, PHP, MySQL on Windows
Home forum
Back to WampServer
presentation
Downloads
Addons
Trainings
Alter Way
Go to Topic:
Previous
•
Next
Go to:
Forum List
•
Message List
•
New Topic
•
Search
•
Log In
•
Print View
format mobile number
Posted by:
joaquinbordado
(---.54.58.197.pldt.net)
Date: June 20, 2008 01:14PM
my input mobile is 9051231223....what i want to do is get the last 10 digit of mobile number and append 0 at the beginning. can someone help me with that..
Options:
Reply
•
Quote
Re: format mobile number
Posted by:
stevenmartin99
(---.34-85-b.business.telecomitalia.it)
Date: June 20, 2008 05:52PM
use as a text field and not a number. s u wont ever be adding mobile numbers
Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [
pampserver.com
]
Options:
Reply
•
Quote
Re: format mobile number
Posted by:
toivo
(---.nsw.bigpond.net.au)
Date: June 20, 2008 11:12PM
Something like this:
$mob_number = trim($_POST['mobnumber']);
if (ctype_digit($mob_number) AND strlen($mob_number) == 9) {
$mob_number = '0' . $mob_number;
} else {
echo 'Invalid format';
}
Regards,
toivo
Sydney, Australia
Options:
Reply
•
Quote
Go to:
Forum List
•
Message List
•
Search
•
Log In
Sorry, only registered users may post in this forum.
Click here to login