Outputting Using array_values() and array_keys() for Backward Compatibility : array_keys « Data Structure « PHP






Outputting Using array_values() and array_keys() for Backward Compatibility

 
<?
    $countries_languages = array('Germany' => 'German', 'France' => 'French', 'Spain' => 'Spanish'); 
    
    printf("<p>Languages: %s.</p>\n", 
    implode(', ', array_values($countries_languages)) ); 
    
    printf("<p>Countries: %s.</p>\n", 
    implode(', ', array_keys($countries_languages)) ); 
    
?>
  
  








Related examples in the same category

1.Return all the keys of an array with array array_keys (array input [, mixed search_value])
2.array_keys( ) returns an array of all the keys in that array
3.array_keys() function returns an array containing all keys