How to display a return value on the browser?

robarsawei

New Member
I have the following inside a function something():\[code\]if ($cod == 1000){ $message = 'Some Message'; return $message;}\[/code\]Later, I call this function:\[code\]try{ $comandoController->someThing();}\[/code\]I was expecting to see "Some Message" on the browser. But I don't.Note: If I \[code\]echo\[/code\] something like \[code\]echo "hello"\[/code\] inside the conditional, I can see it. So the condition is the case.Instead of \[code\]$comandoController->someThing();\[/code\] should we do the following:\[code\]$result = $comandoController->someThing(); echo $result; \[/code\]
 
Back
Top