Hey all,
I'm very new to programming and PHP.
I want to pass instances of a class through an array, and then use a foreach
later to grab details of each class at once... but it returns a fatal error
Code:
$me = new Toon('Toon1','1')
$him = new Toon('Toon2','0')
$characterListing = array($me,
ge the $newarray[$name] to something to represent the current
element and just add the value to it?
I might be able to work around it then
""Jeff Taylor"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey everyone,
> Newb back again - Im trying to popu
;
}
else
{
$newarray[$name] = 2;
}
}
Sorry for the spam everyone
"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sat, 2007-03-10 at 15:31 +1030, Jeff Taylor wrote:
> > Hey everyone,
> > Newb back again - Im trying to
;
>
> On Thu, March 8, 2007 11:51 pm, Jeff Taylor wrote:
> > Hey all,
> > I'm very new to programming and PHP.
> > I want to pass instances of a class through an array, and then use a
> > foreach
> > later to grab details of each class at once... but it returns
Hey all, got a slight problem, where for some reasons my variables dont seem
to be getting stored in the child class:
e.g
class Parent
{
$private type;
public function __construct()
{
}
public function GetType()
{
return $this->type;
}
}
class Child implements Parent
{
OOPS!... typo
Please replace implements with extends:
class Child extends Parent
Sorry about that
""Jeff Taylor"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey all, got a slight problem, where for some reasons my variables dont
seem
> t
Child class __construct
$this->foo.='Bar';
$this->foo2 .= rand(1,6);
$this->type = 'Child';
Outputs of variables foo == Bar Bar
foo2 == 11-16
type == Child
Th
Thanks everyone,
Gave me a much better understanding of it
"Jim Lucas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Jim Lucas wrote:
> > Jeff Taylor wrote:
> >> Hey all, got a slight problem, where for some reasons my variables
> >>
8 matches
Mail list logo