Codeigniter php code is not result
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 have moved my Script from single host to digitalocean droplet. when im running my code somehow my general_helper prints the code to the screen and doesn't run it properly and it crashes.
general helper in my sub 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?
+3
source to share
1 answer
Change the open tag <?
to full tag <?php
.
short_open_tag
Disabled for hosts in php.ini configuration file. Give them permission and you won't have any problems.
More info: How to enable PHP short tags?
+1
source to share