Heres a code:
class test {
var $cookie = time()+50000;
function importantfunction(){
//do something important.
}
}
//next page
$test = new test;
$test->importantfunction();
i had a bunch of functions
and i stripped it all down, and found that if i had this written in the class... It makes a blank page. Why can't i enter a variable and use a built in function?
everytime i use a built in function while defining my vars, it gives a blank page.
If this is an innappropriate way to use Classes...
How should i define time()+50000, to $test->cookie?
And also, this is a valid way to use classes right?:
class test2 {
var $info;
function doID($id){
//function that does something with ID.
}
}
$test2 = new test2();
$test2->doID(335);
That should work if im not mistaken, the "$test2->doID(335)" is in another page.
Because i am not sure if i can insert something info into a function inside a class.