Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我对编码相当陌生...
我希望能够在循环中将 PHP 变量从保持值“q1”更改为“q2”、“q3”等。
q1 ect 与数据库中的问题 id 相关,我希望能够实现的最终结果是增加 qnumber 以便为正确的问题编号记录下一个问题的答案。
干杯
for($i=1; $i<=$limit; $i++) { $var = 'q'.$i; }
在伪代码中:
$var = "q"; $i = 1; for $i to N-1 $var.$i//do whatever. $var.i concatenates.