所在版块:社会百科 发贴时间:2003-08-24 17:39  评分:

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
parse_str()就是把query string放到variable里面,以下示例是从php documentation里面拿的

---------------------
Description
void parse_str ( string str [, array arr])


Parses str as if it were the query string passed via an URL and sets variables in the current scope. If the second parameter arr is present, variables are stored in this variable as array elements instead.

Example 1. Using parse_str()

<?php
$str = "first=value&arr[]=foo+bar&arr[]=baz";
parse_str($str);
echo $first; // value
echo $arr[0]; // foo bar
echo $arr[1]; // baz

parse_str($str, $output);
echo $output['first']; // value
echo $output['arr'][0]; // foo bar
echo $output['arr'][1]; // baz

?>
--------------------------
从上面看应该还是需要知道那些variable的名字的,其实跟用$_GET是一回事了。

不太清楚你为什么让query string不定,如果不方便用名字来address $_GET, 可以改用数字index啊。
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

Put your OWN COOL signature here!
 相关帖子 我要回复↙ ↗回到正文
问个弱智问题,关于PHP Wahoo   (41 bytes , 373reads )
是在一个array里面 我心为谁动   (58 bytes , 179reads )
那如果我的QUERY_STRING是不定的呢? Wahoo   (36 bytes , 162reads )
我心为谁动   (909 bytes , 282reads )
我找到答案了 Wahoo   (104 bytes , 175reads )