PHP Class variable access question

FrenD

New Member
I'm having trouble accessing a class' variable.I have the functions below in the class.\[code\]class Profile { var $Heading; // ... function setPageTitle($title) { $this->Heading = $title; echo 'S: ' . $this->Heading; } function getPageTitle2() { echo 'G: ' . $this->Heading; return $this->Heading; }// ...}\[/code\]Now when I run the method \[code\]$this->setPageTitle("test")\[/code\] I only get \[code\]G: S: test\[/code\]What's wrong with the \[code\]getPageTitle2\[/code\] function? Heading is public btw. Please help!Thanks guys!
 
Back
Top