Example #1
0
function decode($string, $array)
{
    $output = "";
    $words = explode(" ", $string);
    foreach ($words as $word) {
        $upper = isUpper($word);
        $word = strtolower($word);
        if ($key = array_search($word, $array)) {
            if ($upper) {
                $key = strtoupper($key);
            }
            $output = "{$output}{$key}";
        } else {
            $output = "{$output}{$word}";
        }
    }
    return $output;
}
Example #2
0
function isChar($s)
{
    return isLower($s) || isUpper($s);
}