Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How come the code <?php print "contents: $arr[1]"; ?> Works, but <?php print "contents: $arr[1][2]"; ?> Doesn't for two-dimensional array of mine?



How come the code <?php print "contents: $arr[1]"; ?> Works, but <?php print &quo..

Answer / Nimmi Gupta

The reason is that you are trying to access a nested element in your array. In PHP, arrays are zero-indexed, so if you have a two-dimensional array and you want to access the second row and third column, you should use $arr[1][2], not $arr[1][3]. The 0-based indexing causes an error when you try to access elements outside of the defined range.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More WordPress Interview Questions

Will I have the ability to update my own content?

1 Answers  


Is wordpress really free?

1 Answers  


Is wix cheaper than wordpress?

1 Answers  


What are the steps should be followed for installing wordpress?

1 Answers  


When should you not recommend wordpress to a client?

1 Answers  


What's the difference between a blog and a website?

1 Answers  


How do I get an ssl certificate?

1 Answers  


What is usermeta function in wordpress?

1 Answers  


Template files list for development wordpress theme?

1 Answers  


What is a mega menu?

1 Answers  


How will you create a template page in wordpress?

1 Answers  


What is a social menu on wordpress?

1 Answers  


Categories