PurabTech is technical blog for Programmer and Coders
how to work with multidimensional array in php
If you are programmer then you dont need introduction of array. In every language array is the most important part.
how to work with multidimensional array in php
Using array we can achieve so many things and array is useful for so many times when we do programming.
In this article I am going to share some method about PHP array.
What is PHP array?
An array in PHP is actually an ordered map. A map is a type that associates values to keys. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more. As array values can be other arrays, trees and multidimensional arrays are also possible.
3 thoughts on “how to work with multidimensional array in php”
Thanks for this article on arrays. I have a question about WordPress and arrays. Here’s my situation. I have a custom post type called “property” and a custom field called “prop_state”. The prop_state contains a US state word like “Ohio”, “Illinois”, etc. I want to build an array that looks in the “property” post type and see what states are in the database and then give me a count of each state. For instance “There are 11 properties in Illinois”. Can you point me down the right road? I would appreciate any feedback you can lend.
easiest solution would be creating US states as tags or category and using query_posts or wp_query you are able to get count of property easily. If you want keep US states as a meta fields than. it is also doable. you can pass custom field parameters to wp_query. check this documentation.
I do not even know how I ended up here, however I assumed this put
up was great. I do not understand who you are however definitely you are going
to a famous blogger when you are not already. Cheers!
Thanks for this article on arrays. I have a question about WordPress and arrays. Here’s my situation. I have a custom post type called “property” and a custom field called “prop_state”. The prop_state contains a US state word like “Ohio”, “Illinois”, etc. I want to build an array that looks in the “property” post type and see what states are in the database and then give me a count of each state. For instance “There are 11 properties in Illinois”. Can you point me down the right road? I would appreciate any feedback you can lend.
easiest solution would be creating US states as tags or category and using query_posts or wp_query you are able to get count of property easily. If you want keep US states as a meta fields than. it is also doable. you can pass custom field parameters to wp_query. check this documentation.
I do not even know how I ended up here, however I assumed this put
up was great. I do not understand who you are however definitely you are going
to a famous blogger when you are not already. Cheers!