pouncer Posted November 8, 2006 Share Posted November 8, 2006 take for e.g[code=php:0]class Test {function Hello() {echo "hi";}function Bye() {echo "Bye";}function Hmm() {//how do i call Hello() here?}}[/code] Quote Link to comment Share on other sites More sharing options...
blear Posted November 8, 2006 Share Posted November 8, 2006 [code]$this->Hello()[/code]That snipet, anywhere inside the class, will call the function in the class Hello() Quote Link to comment Share on other sites More sharing options...
pouncer Posted November 8, 2006 Author Share Posted November 8, 2006 ahh, I see now. Thanks.another question while we are here buddy.echo "Welcome back $log->GetUserName()";when i do echo $log->GetUserName();then it echos Johnbut how do i get the first one working? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted November 9, 2006 Share Posted November 9, 2006 You will need to to use the concatenation operator (.):[code]echo "Welcome back " . $log->GetUserName();[/code] Quote Link to comment Share on other sites More sharing options...
Zane Posted November 9, 2006 Share Posted November 9, 2006 or encapsulate it with curly braces[code=php:0]echo "Welcome back {$log->GetUserName()}";[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.