oquidave

dynamic arrays

Jul 13th, 2011
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. thislocation_arr = array();
  2. $location = array('a', 'b', 'c');
  3.  
  4. for ($i = 0; $i < $rownum; $i++) {
  5. //dynamically name a array
  6. $location.${$location} = array();
  7. //add date values to this array
  8. $location.${$location}[$i] = $somevalue;
  9. //add dyanamic array value to the main associated array
  10. $thislocation_arr[$location] = $location.${$location};
  11. }
Advertisement
Add Comment
Please, Sign In to add comment