Skip to content

Instantly share code, notes, and snippets.

@gjnoonan
Created September 24, 2011 13:05
Show Gist options
  • Save gjnoonan/1239307 to your computer and use it in GitHub Desktop.
Save gjnoonan/1239307 to your computer and use it in GitHub Desktop.
running PHP 5.3.6 with (/usr/bin/php) >>>
Array
(
[Format] => DVD Video Disc - DVD / Normal
[OriginalLanguage] => Swedish
)
Format: DVD Video Disc - DVD / Normal
<?php
$headings = array('Format', 'Original language');
$results = array('DVD Video Disc - DVD / Normal', 'Swedish');
function sanitise($string){ return str_replace(" ", "", ucwords($string)); }
$clean_headings = array_map("sanitise", $headings);
$combined_results =
array_combine($clean_headings, $results);
print_r($combined_results);
print "Format: ".$combined_results['Format'];
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment