<?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
?
但是出现了这个错误:
Parse error: syntax error, unexpected 'echo' (T_ECHO)
in /home/mcthebli/public_html/test.php on line 36
有人知道我出了什么问题吗?:/