Subscribe to RSS Subscribe to Comments

Alan Blaine Whitney

gzip compression

A very typical sql file

~# mysqldump -u root -p db > ~/sql
~# du -h sql 
45M	sql
~# gzip sql
~# du -h sql.gz 
11M	sql.gz

PHP Oddity

This was tested on PHP 5.2.6 and 5.2.10, you mileage may actually vary.

 <?php
$number = 20864.01;
$num = $number * 100;
echo intval($num);
?>

If such a piece of code was ran, but would one expect, 2086401 maybe. I would, but you actually get 2086400. Strange.

<?php
$number = 20864.01;
$num = $number * 100;
echo intval(round($num));
?>

That will give you 2086401.

UPDATE: I guess this problem is not a PHP per se but a glibc issue.

Based on FluidityTheme Redesigned by Kaushal Sheth Sponsored by Send Flowers