【发布时间】:2012-05-25 00:26:30
【问题描述】:
您好,我正在尝试让一个变量在对另一个变量执行 if 语句之后进行设置,但我无法正确使用语法。请帮忙,这是我目前得到的代码。
$subtype = htmlspecialchars($_POST['subtype']);
if $subtype == ['12m'] {$subprice = 273.78}
elseif $subtype == ['6m'] {$subprice = 152.10}
elseif $subtype == ('1m') {$subprice = 30.42}
任何帮助将不胜感激!
【问题讨论】:
标签: php arrays variables if-statement