Below is some code I've been trying, and I've messed about with it to include die()'s and echo()'s here and there but nothing happens, if I try running someone else's class code with instances of the objects it works fine, but I can't see what's wrong with my code.
class Form {
private $form_method;
public function __construct()
{
$form_method = '';
}
public function setFormMethod($method)
{
$this->$form_method=$method;
}
public function getFormMethod()
{
return $this->$form_method;
}
}
$newForm = new Form();
$newForm->setFormMethod('POST');
$var = getFormMethod();
echo $var;
I am running PHP 5.3.2 on a localhost through XAMPP by the way.
Any help appreciated