lilman Posted November 18, 2006 Share Posted November 18, 2006 I have an associative array, and I want to pull each key of the array by using a loop, but I am not sure how to pull just the key in the array. Could someone inform me how I can do this, thank you. Link to comment https://forums.phpfreaks.com/topic/27649-pull-one-key/ Share on other sites More sharing options...
trq Posted November 18, 2006 Share Posted November 18, 2006 [code]<?php $array = array('foo' => 'bar','bill' => 'bob'); $keys = array_keys($array); foreach ($keys as $key) { echo $key."\n"; }?>[/code] Link to comment https://forums.phpfreaks.com/topic/27649-pull-one-key/#findComment-126482 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.