<?php
$val1 = echo "".$response['players'].""; // it will output 1
$val2 = echo "".$response['maxplayers'].""; // it will output 3
$res = ($val1/$val2) * 100;
echo $res; // it will output 33,33333
?
但這種錯誤出現:PHP:回聲不工作
Parse error: syntax error, unexpected 'echo' (T_ECHO)
in /home/mcthebli/public_html/test.php on line 36
有人知道我去錯了嗎? :/
這是36行之前,什麼?你可能錯過了一個分號或什麼的。 –
哦,等待我被阻止。也許我應該閱讀代碼,而不是錯誤。別管我。 –