PHP and Class Variables

by John H
~1 minute

Pass a variable into a class through the construct($variable) function


Variables set in the
Construct can be referenced throughout the class as $this->variable

Can be referenced outside the class as
$Class->variable

Variable Can be passed into a class function like Class::function(variable);

Related Articles

PHP Sessions and SSL

I may want to make it so that I my php sessions last longer on a project that I'm working on right...

John H John H
~1 minute

PHP Cookie Problems

Cookies have been around forever - they are browser based variables that can be set to expire in...

John H John H
7 minutes

JavaScript Concatenation and Multiple Line Variables

JavaScript has some idiosyncrasies that make me want to pull my hair out sometimes. The worst part...

John H John H
2 minutes