3
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 Answer 1

1

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?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.