Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
codeigniter geoPlugin类开关语句不工作_Codeigniter_Switch Statement - Fatal编程技术网

codeigniter geoPlugin类开关语句不工作

codeigniter geoPlugin类开关语句不工作,codeigniter,switch-statement,Codeigniter,Switch Statement,在使用php类时,我遇到了switch语句和if-else语句的问题 请检查代码: $geoplugin = new geoPlugin(); $currency_code ="{$geoplugin->currencyCode} "; switch语句 switch ($currency_code) { case "EUR": $new_currency_code = $currency_code; break; default: $new_cur

在使用php类时,我遇到了switch语句和if-else语句的问题

请检查代码:

$geoplugin = new geoPlugin();
$currency_code ="{$geoplugin->currencyCode} ";
switch语句

switch ($currency_code) {
case "EUR":       
   $new_currency_code = $currency_code;
    break;
 default:
    $new_currency_code = $constant_currency;
    break;
比较后,$new_currency_代码为asign,如果“EUR”与案例不匹配,则$constant_currency为,例如:“USD”

然而,代码规范对我不起作用,但direct echo正在起作用

echo $currency_code;

任何人都可以帮忙吗?

你总是得到
欧元吗?
?不,默认状态有效!你有空的空间在这结束<代码>“{$geoplugin->currencyCode}”我的意思是在
}
之后。是的,但这不是问题所在!