zeusthegreat Posted February 18, 2011 Report Share Posted February 18, 2011 head> <meta http-equiv="Content-Type" Content="text/html; charset=iso-8859-1"> <title></Title> </head> <body> <?php include("class.php"); ?> <?php include("classdog.php"); ?> <?php $my_snake = new snake(); $my_snake->eat_bugs(); $dog = new dog(); $dog->eat_snake(); ?> </body> </html> index.php <?php //How . or if, do i use a function from an class while in an other class. class snake { function eat_bugs() { echo "He eats bugs."; } } ?> class.php <?php class dog { function eat_snake() { echo "The dog ate the snake!"; } } ?> classdog.php cannot get the second message to show no error it just is not showing (the dog ate the snake) being the message.... must be something simple please help and thankyou for any help Quote Link to comment Share on other sites More sharing options...
BeeDev Posted February 18, 2011 Report Share Posted February 18, 2011 Works on my end. Shows: He eats bugs.The dog ate the snake! 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.
Note: Your post will require moderator approval before it will be visible.