codeigniter geoPlugin类开关语句不工作
在使用php类时,我遇到了switch语句和if-else语句的问题 请检查代码: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
$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}”代码>我的意思是在}
之后。是的,但这不是问题所在!