PHP Class - Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phppick
Forum Commoner
Posts: 57
Joined: Thu Aug 14, 2003 5:59 am

PHP Class - Error

Post by phppick »

class Test{

function Test(){
echo "FirstName";
}

function TestMe(){
echo " LastName";
}

}

$sun=new Test();

function Find($var){
$sun->TestMe(); //-----------***
echo $var;echo "<br>";
echo "Some text";
}

call_user_func('Find',$variable);
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

You didn't say what error you're getting but I'm guessing it's because $sun hasn't been passed into the fn.
Post Reply