dsdsds12222 2015-05-27 23:58
浏览 83
已采纳

codeigniter php输出代码不是结果

lang->line($langLine); } return $outcome; } function langW($string, $var1 = FALSE, $var2 = FALSE, $var3 = FALSE) { return sprintf(lang($string), ($var1 ? $var1 : ''), ($var2 ? $var2 : '')); } function langV($line, $var) { $ci = & get_instance(); return sprintf($ci->lang->line($line), $var); }
Fatal error: Call to undefined function lang() in application/language/english/english_lang.php on line 252

I moved my Script from one host to a droplet by digitalocean. when im running my code somehow my general_helper is outputting the code to the screen and not running it as it should, and that cause the crash.

general-helper in my helper folder.

    <?



function lang($line) {

    $ci = & get_instance();
    $languageVariable = explode(" ", $line);
    $outcome = '';
        foreach($languageVariable as $langLine) {
        $outcome .= $ci->lang->line($langLine);

        }
        return $outcome;


}

function langW($string, $var1 = FALSE, $var2 = FALSE, $var3 = FALSE)
{
    return sprintf(lang($string), ($var1 ? $var1 : ''), ($var2 ? $var2 : ''));
}



function langV($line, $var)
{
    $ci = & get_instance();
    return sprintf($ci->lang->line($line), $var);
}

how can i fix this?

展开全部

  • 写回答

1条回答 默认 最新

  • douxiajia6309 2015-05-28 00:01
    关注

    Change open tag <? to full tag <?php.

    For hosts short_open_tag in php.ini configuration file are disabled. Allow them and you wont have problems.

    More info: How to enable PHP short tags?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?