June 20, 201412 yr Is there a way of passing the constant into the function as the 2nd parameter? <?php class WeightConv2 { public $kilo = 1; const CONV = 2.2; public function calConv2($a_lbs, const(CONV)) { $lbs = $a_lbs * $a_conv; return $lbs; } } $getConv = new WeightConv2(); $rtnValue = $getConv->calConv2($getConv->kilo, self::CONV); echo "$getConv->kilo KILO is $rtnValue LBS"; ?>
June 20, 201412 yr Author well 2.2lbs is = to 1 kilo so it would never change and therefore be a constant so not sure your negative point citypaul. Same as math PI 3.14 it never changes. Thanks NOCK for your help
Create an account or sign in to comment