You should use a for-each loop.
foreach($array AS $domain => $domains) {
printf("%s has %s\r\n", $domain, implode(", ", $domains));
}
More Related Contents:
- How to make array inside in foreach loop – php? [closed]
- How do search array values and remove them based on a condition or string? [closed]
- How to sum the values of an associative array?
- Remove empty array elements
- Two arrays in foreach loop
- Sort multidimensional array by multiple columns
- Preferred method to store PHP arrays (json_encode vs serialize)
- Recursive function to generate multidimensional array from database result
- PHP – Check if two arrays are equal
- Get first key in a (possibly) associative array?
- Difference in accessing arrays in PHP 5.3 and 5.4 or some configuration mismatch?
- Characters allowed in php array keys?
- How to remove a variable from a PHP session array
- Will copy-on-write prevent data duplication on arrays?
- use strings to access (potentially large) multidimensional arrays
- Nested array. Third level is disappearing
- Looping a multidimensional array in php
- Make multiple files to force-download
- Keep Duplicates while Using array_diff
- Array_map function in php with parameter
- More concise way to check to see if an array contains only numbers (integers)
- How to merge two arrays by summing the merged values [duplicate]
- Is PHP’s count() function O(1) or O(n) for arrays?
- How to search in an array with preg_match?
- Convert a String to Variable
- How do I select 10 random things from a list in PHP?
- How to iterate through a nested stdClass? [duplicate]
- How to get the object or class name?
- PHP convert nested array to single array while concatenating keys?
- Group array data on one column and sum data from another column to form a flat associative array