Re: number format

From: Date: Mon, 29 Nov 2004 07:24:01 +0000
Subject: Re: number format
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-37433@lists.php.net to get a copy of this message
Balwantsingh wrote:
hello, may pls. suggest me how i can retreive number before decimal and after decimal. for example 123456.7. I want to store 123456 in a variable and 7 in another. also how can i force the user by validations so that he can only enter data in this format only i.e. 123456.7. thanks with best wishes balwant
Use explode() $num = 123456.7; $parts = explode(".", $num); echo "$part[0]\n"; echo "$part[1]"; -- -- ShenKong (shenkong@php.net) -- http://www.openphp.cn

« previous php.db (#37433) next »