Link to home
Start Free TrialLog in
Avatar of kadin
kadinFlag for United States of America

asked on

Simple math in php

Why does it echo 0.04 and 0.0333333333333 and not 25 and 30?
How do I fix? Thanks.

<?php
error_reporting(E_ALL);

$width = '50';
$height = '20';

$newWidth = 2/(100 - $width);
$newHeight = 2/(80 - $height);

echo $newWidth;
echo $newHeight;

?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of psimation
psimation
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kadin

ASKER

Thank you.