Hi guys, I have this seemingly silly problem. I'm not sure whether it's to do with php5 or not, as I've done this type of thing numerous times before without any problems, what stupid thing am I missing?
Code: Select all
class files {
/**
* @return array
* @param mixed $file
* @desc class constructer, places contents of file in array
**/
function files($file) {
return file($file);
}
}
I'm calling this class on a seperate page as follows:
Code: Select all
require_once('common/files.class.php');
$f = new files($_FILES['file']['tmp_name']);
var_dump($f);
The problem being the results of var_dump are
This is not correct as doing a var_dump within the function files() confirms everything is as it should be, just not after it is returned. Any ideas what i'm doing wrong? Also as I've just upgraded to php5 should I be able to use the _construct() instead of the function files() in my class ? thanks.