populating associative array from a function

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Sat Mar 29, 2014 1:04 am

Your challenge is coming from the scope of the variable containing the array. If you're declaring it outside of the function, make sure you use global $variableName; in the function to specify that you're going to be referencing th global variable rather than one in local scope. if the variable is defined locally to the function (inside the function) then you'd have to return it to the calling context in order to make the results available

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests