lenerd3000 Posted April 28, 2008 Share Posted April 28, 2008 i have a functions declared in the other page and a class in another page... is it possible to make the functions become my class's own functions? i want to make a simple core files for my website. Quote Link to comment Share on other sites More sharing options...
trq Posted April 28, 2008 Share Posted April 28, 2008 <?php class a { public function foo() { echo "this is foo\n"; } } class b extends a { public function bar() { echo "this is bar\n"; } } $obj = new b; $obj->foo(); $obj->bar(); ?> 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.