见了鬼了, $_request的有关问题
程序员文章站
2022-04-25 10:42:09
...
见了鬼了, $_request的问题.
$counter =0;
$temp = 0;
while(!is_null ($_REQUEST[ 'thisAnswer_id '. ++$counter]));
{
++$temp;
echo "~~ temp is ".$temp. "~~ ";
echo "~~ Counter is " .$counter. "~~ ";
$thisAnswer_id = array($counter => $_REQUEST[ 'thisAnswer_id '.$counter]);
?>
输出结果是:
~~~ temp is 1 ~~~
~~~ counter is 3 ~~~
而且循环仅仅执行一次, 其实前面会传过来好几个值呢.
做这个的目的是想让前一页传过来的许多个属性相同的值用循环的方法接收并且存入数组中.
请高人给看看这是怎么回事啊, 谢谢
------解决方案--------------------
while(!is_null ($_REQUEST[ 'thisAnswer_id '. ++$counter]));
这行后面的 "; "号去掉....
后面还差个 } 号.
$counter =0;
$temp = 0;
while(!is_null ($_REQUEST[ 'thisAnswer_id '. ++$counter]));
{
++$temp;
echo "~~ temp is ".$temp. "~~ ";
echo "~~ Counter is " .$counter. "~~ ";
$thisAnswer_id = array($counter => $_REQUEST[ 'thisAnswer_id '.$counter]);
?>
输出结果是:
~~~ temp is 1 ~~~
~~~ counter is 3 ~~~
而且循环仅仅执行一次, 其实前面会传过来好几个值呢.
做这个的目的是想让前一页传过来的许多个属性相同的值用循环的方法接收并且存入数组中.
请高人给看看这是怎么回事啊, 谢谢
------解决方案--------------------
while(!is_null ($_REQUEST[ 'thisAnswer_id '. ++$counter]));
这行后面的 "; "号去掉....
后面还差个 } 号.
相关文章
相关视频
- 详解win10下PHP的安装配置(以php5.6为...
- php Swoole实现毫秒定时计划任务(详解)
- 【DTM】PHP协程客户端v0.1 beta版本发...
- 一文详解Windows和Linux环境下怎么安装配...
- 见了鬼了, $_request的有关问题
上一篇: 浅谈触发器和存储过程