[Solved] Return $data question |
When I var dump my my $message variable it displays the multiple messages which is correct.
But the return only shows one as shown here. How can I produce the same on return PHP Code: public function display_error_messages($open_tag = '<p>', $close_tag = '</p>') {
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
You recreate (and overwrite) the $message variable instead of appending the second and third messages to it. Try:
PHP Code: $message .= $open_tag . $msg . $close_tag;
(02-15-2016, 02:51 AM)Diederik Wrote: You recreate (and overwrite) the $message variable instead of appending the second and third messages to it. Try: I did this now but no getting undefined variable $message PHP Code: public function display_error_messages($open_tag = '<p>', $close_tag = '</p>') {
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
Define $message='' before entering the foreach loop.
Website: http://avenir.ro
(02-15-2016, 03:02 AM)Avenirer Wrote: Define $message='' before entering the foreach loop. Is This Correct PHP Code: public function display_error_messages($open_tag = '<p>', $close_tag = '</p>') {
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
if you defined the $message depending on the if statement, then you should also return the $message from inside the if statement...
Code: public function display_error_messages($open_tag = '<p>', $close_tag = '</p>') { Website: http://avenir.ro
(02-15-2016, 03:27 AM)Avenirer Wrote: if you defined the $message depending on the if statement, then you should also return the $message from inside the if statement... Thank you for help it all works now. And thank you to every body else to.
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
|
Welcome Guest, Not a member yet? Register Sign In |