About 705,000 results
Open links in new tab
  1. How can I loop through an associative array and get the key?

    86 If you use array_keys(), PHP will give you an array filled with just the keys:

  2. How to use PHP in_array with associative array? - Stack Overflow

    First you must know which part of the associative array you're going to use as haystack in in_array function. Then you can use in_array without additional code.

  3. How to check if PHP array is associative or sequential?

    Oct 6, 2008 · PHP treats all arrays as associative, so there aren't any built in functions. Can anyone recommend a fairly efficient way to check if an array "is a list" (contains …

  4. php - Iterating over a two dimensional array - Stack Overflow

    Is there an easy way to iterate over an associative array of this structure in PHP: The array $searches has a numbered index, with between 4 and 5 associative parts.

  5. How to get the first item from an associative PHP array?

    Oct 24, 2009 · The inverse of this task is to use end() or array_key_last(): Return an element from the last array in a multidimensional array in PHP

  6. Value objects vs associative arrays in PHP - Stack Overflow

    Jan 29, 2012 · Associative arrays in PHP is a VERY nice feature but i think that harms php enterprise applications. When you write code you want to get clean and maintainable application.

  7. Convert an associative array to a simple array of its values in php

    5 create a new array, use a foreach loop in PHP to copy all the values from associative array into a simple array

  8. php - Hash tables vs. associative arrays - Stack Overflow

    The difference between an associative array and a hash table is that an associative array is a data type, while a hash table is a data implementation. Obviously the associative array type is …

  9. Sort an array of associative arrays by column value

    I jumped here for associative array sorting and found this amazing function on sort. This function is very dynamic and sort in ascending and descending order with a specified key.

  10. php - How to convert a simple array to an associative array?

    You want an array where the keys go from 1 to 5 (or in other words, you want to set the values of the on array as keys of the other). But still, both arrays are associative.