if (is_array($input)) 
        {
            $encoded = array();
            foreach ($input as $index => $char) 
            {