linux1880 Posted August 29, 2010 Share Posted August 29, 2010 Hi friends how does this types of array operate ? pls help, I am repeatedly facing this code but my brain can't hold, i am familiar with multi dimensional array but what are these ? $data[$row['id']] $options['data']=$row[0]; Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 29, 2010 Share Posted August 29, 2010 Well the first is grabbing an item from the $data array, based on the value of $row['id']. So if $row['id'] is set to 5 then the following echo $data[$row['id']]; Is the same as echo $data[5]; This $options['data']=$row[0]; Is just variable assignment. Except they are arrays. Quote Link to comment Share on other sites More sharing options...
linux1880 Posted August 29, 2010 Author Share Posted August 29, 2010 what does empty array such as $row[] means ? Quote Link to comment Share on other sites More sharing options...
Alex Posted August 29, 2010 Share Posted August 29, 2010 $row[] = "value"; Would add an element to the end of the $row array with the value of "value". Quote Link to comment Share on other sites More sharing options...
linux1880 Posted August 29, 2010 Author Share Posted August 29, 2010 Thnaks alex, got it, but I am not very clear on original question. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.