Visually I want to have this:

Each Yellow Text is a class that I included and = new ClassName;
However, I can't seem to get a new class "created" for each new variable.
For example:
Main.php
Code: Select all
<?php
include "bot/_bots.php";
$bot1 = new cBot;
echo $bot1->_conn->hi;
echo "New line test <br />";
$bot2 = new cBot;
echo $bot2->_conn->hi;
?>
Code: Select all
<?php
class cBot {
var $_conn;
function cBot() {
include "_botServ.php";
$this->_conn = new server();
}
}
?>
Code: Select all
<?php
class server {
var $hi = "Hello World<br />";
function server() {
echo "I've been started!<br />";
}
function getHi(){
echo $this->hi;
}
}
?>
Thanks everyone.