Re: Changing Bytes to KB, to megs, to gigs.

From: Date: Sun, 27 Jul 2003 00:21:12 +0000
Subject: Re: Changing Bytes to KB, to megs, to gigs.
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-157043@lists.php.net to get a copy of this message
Thanks, that seems to work very well (o; / Josh ----- Original Message ----- From: "Curt Zirzow" <curt@zirzow.dyndns.org> To: "PHP" <php-general@lists.php.net> Sent: Sunday, July 27, 2003 10:17 AM Subject: Re: [PHP] Changing Bytes to KB, to megs, to gigs. > * Thus wrote Matthew A. Blasinski (mablasinski@doit.wisc.edu): > > Philip J. Newman wrote: > > >My goal is to input the amount of Bytes used by a user as $inputbox and > > >calculate how many kbs,megs,gigs along with $cost for the price per meg. > > > > [...] > > > > 3) Use a search and replace (regular expression) to replace commas with > > empty strings. ereg_replace("," "", $string) - > > http://us4.php.net/manual/en/function.ereg-replace.php > > to go further with this you could make sure they enter a valid > number: > > $string = ereg_replace("[^0-9.]", "", $string); > > > > Curt > -- > "I used to think I was indecisive, but now I'm not so sure." > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#157043) next »