Skip to content

Instantly share code, notes, and snippets.

@jblac
Last active December 12, 2015 10:18
Show Gist options
  • Save jblac/4757882 to your computer and use it in GitHub Desktop.
Save jblac/4757882 to your computer and use it in GitHub Desktop.
<?php
function replacer($array) {
$newArray = array();
foreach ($array as $key=>$val) {
if (preg_grep('/^$/', $val)) {
$newArray[$key] = "empty";
} else {
$newArray[$key] = $val;
}
}
return $newArray;
}
$res = $this->replacer($res);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment