RE: [PHP] Getting ip address of client and displaying a number in decimal format.

From: Date: Fri, 14 Sep 2001 00:35:52 +0000
Subject: RE: [PHP] Getting ip address of client and displaying a number in decimal format.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-67287@lists.php.net to get a copy of this message
Troy, $REMOTE_ADDR gives you the client IP. To convert a number to show 2 decimals use "sprintf": $money = 5; $money_string = sprintf("%.2f", $money); // $money_string will be 5.00 Cheers, Kelly. > -----Original Message----- > From: Troy Lynch [mailto:troy@abidon.com] > Sent: Friday, 14 September 2001 8:49 AM > To: php-general@lists.php.net > Subject: [PHP] Getting ip address of client and displaying a number in > decimal format. > > > I'm trying to find out how to do 2 things one. I'd like to get the ip > address of the client machine so I can write it to a database. > And then I'd > like to convert a number to show 2 decmials to the right like for money > etc.... > > > Thanks > > Troy > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#67287) next »