This should do it
foreach($yourArray as $key => $value) {
//do something with your $key and $value;
echo '<a href="' . $value . '">' . $key . '</a>';
}
Edit: As per Capsule’s comment – changed to single quotes.
More Related Contents:
- count how many duplicate keys are in array of objects?
- PHP – File to Associative Array with 1 key and two values attached
- Filter array by its keys using an array of allowed keys
- How to combine two arrays together?
- Replace keys in an array based on another lookup/mapping array
- How to re-index the values of an array in PHP? [duplicate]
- Remove all elements from array that do not start with a certain string
- Characters allowed in php array keys?
- Get the keys for duplicate values in an array
- How to find array / dictionary value using key?
- PHP – Find parent key of array
- How to filter an associative array comparing keys with values in an indexed array?
- How to access first level keys of a 2d array with a foreach loop? [duplicate]
- Add elements to array which has gapped numeric keys to form an indexed array / list
- What is the max key size for an array in PHP?
- Custom key-sort a flat associative based on another array
- Rename key in each row of a 2d array
- Is there a way to change all keys in a flat indexed array to the same string (“Name”)? [closed]
- fetch data inmultidimensional array in PHP [closed]
- Split a comma-delimited string into an array?
- Implode an array with “, ” and add “and ” before the last item
- PHP sort array by two field values [duplicate]
- Sorting a multidimensional array in PHP? [duplicate]
- How to group a multidimensional array by a particular subarray value?
- Converting a SimpleXML Object to an Array [closed]
- Foreach loop inside array
- PHP order array by date? [duplicate]
- Returning Multiple Rows with MySqli and Arrays
- PHP: Split string into array, like explode with no delimiter
- How to create an empty array in PHP with predefined size?