Skip to content

Instantly share code, notes, and snippets.

@jblac
Created February 11, 2013 22:03
Show Gist options
  • Save jblac/4758024 to your computer and use it in GitHub Desktop.
Save jblac/4758024 to your computer and use it in GitHub Desktop.
<?php
function replacer($array) {
$newArray = array();
foreach ($array as $key => $val) {
foreach ($val as $k=>$v) {
if ($v == "" || $v === null) {
$newArray[$key][$k] = "empty";
} else {
$newArray[$key][$k] = $v;
}
}
}
return $newArray;
}
$res = $this->replacer($res);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment