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?
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?