0
我的代碼是:PHP乘陣列()*整數
的POST HTML部分:
<form action='key.php' method='POST'>
<input type='number' name='consumervar[]' value='512'/>
<input type='number' name='consumervar[]' value='256'/>
<input type='number' name='consumervar[]' value='1024'/>
<input type='submit'/>
</form>
PHP代碼key.php:
<?PHP
foreach ($_POST as $key => $value) {
$consumervar = $value*64;
}
print_r($consumervar); // this is for for debug (see array contents)
?>
但是當我運行它的一切再現:
Fatal error: Unsupported operand types in /var/blahblah/blahblah/key.php on line 3
請幫助。如何正確地做到這一點?它需要整64
謝謝!它的作用像魅力。 :d – xZero