Skip to content

Instantly share code, notes, and snippets.

@travisfont
Created May 16, 2014 20:53
Show Gist options
  • Save travisfont/54e3ba2c4bac3e0b9601 to your computer and use it in GitHub Desktop.
Save travisfont/54e3ba2c4bac3e0b9601 to your computer and use it in GitHub Desktop.
Comparisons of str_replace inside a loop
<?php
$aHeader = array_map(function($key)
{
return str_replace(' ', '', $key);
}, $aHeader);
foreach(aHeader as $key => $value)
{
$aheader[tr_replace(' ', '', $key)] = value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment