I have a few classes, initiated on index.php, like so:
<?php
require_once('./classes/core.class.php');
require_once('./classes/forum.class.php');
$core = new core();
$forum = new forum();
?>
Is there any way to use $core within $forum? I can do it by using core::functionName() but not by $core->functionName().
The classes are:
<?php
class forum{
public function functionName(){
I can access it by defining the class again within each function
public function functionName(){
$core = new core();
Thanks in advance
$corewithin$forum? With the code you provided,$core->functionName()should work just fine. Where does$forumcome into play?