onenonly Posted August 2, 2009 Share Posted August 2, 2009 <?php // Get Image Height & WIdth class imagedimension{ public $imagewidth; public $imageheight; // contructer function imagedimension(){ $this->imagewidth = '1000'; $this->imageheight = '2000'; } function getwidth(){ return $this->imagewidth; } function getheight(){ return $this->imageheight; } } $test = new imagedimension(); if($test->imagedimension()){ echo $test->getwidth(); echo $test->getheight(); }else{ echo 'bad'; } ?> shouldnt it be true???? usually its true but not in this situation??? Quote Link to comment Share on other sites More sharing options...
gevans Posted August 2, 2009 Share Posted August 2, 2009 The method isn't returning anything, so you're actually testing nothing, as far as php is concerned that is FALSE. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.