String operator ".=" trouble |
[eluser]DIMM[/eluser]
Hello! I have a small problem which I can not settle. I use .= operator in recursive function which builds a navigation from a database. But it constantly say "Message: Undefined variable: menu" when i use $menu.='addsubstring'. who can say in what problem?
[eluser]devbro[/eluser]
the problem is that your $menu is not defined yet. do something like this: function a() { static $menu = ''; $menu .= 'your sub string'; } for more info on static goto: (example 5) http://ca2.php.net/global
[eluser]RS71[/eluser]
Yea. You're appending to something that doesn't exist. Code: $menu = 'Hello';
[eluser]Colin Williams[/eluser]
That should just be a "Notice" level message. Some people choose to ignore notices.
|
Welcome Guest, Not a member yet? Register Sign In |