我不知道为什么会收到 Parse error: syntax error, unexpected T_IF on line 6。
$sf = array (
"name" => $firstname . ' ' . $lastname,
"email" => $email,
"address" => $shipping_address_1 . if(!empty($shipping_address_2 )) { echo ", " . $shipping_address_2 }
);
print_r($sf);
我想检查 $shipping_address_2 是否不为空,如果不是,则显示它。