★ wanayoo — archive 1999 http://www.php.net/manual/function.parse-str.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Strings
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
Strings
* AddCSlashes
* AddSlashes
* bin2hex
* Chop
* Chr
* chunk_split
* convert_cyr_string
* count_chars
* crc32
* crypt
* echo
* explode
* flush
* get_html_translation_table
* get_meta_tags
* hebrev
* hebrevc
* htmlentities
* htmlspecialchars
* implode
* join
* levenshtein
* ltrim
* md5
* Metaphone
* nl2br
* ob_start
* ob_get_contents
* ob_end_flush
* ob_end_clean
* ob_implicit_flush
* Ord
* parse_str
* print
* printf
* quoted_printable_decode
* quotemeta
* rtrim
* sscanf
* setlocale
* similar_text
* soundex
* sprintf
* strcasecmp
* strchr
* strcmp
* strcspn
* strip_tags
* stripcslashes
* stripslashes
* stristr
* strlen
* str_pad
* strpos
* strrchr
* str_repeat
* strrev
* strrpos
* strspn
* strstr
* strtok
* strtolower
* strtoupper
* str_replace
* strtr
* substr
* substr_count
* substr_replace
* trim
* ucfirst
* ucwords
Manual: parse_str
View the source code for this pageSearch the site



Previous page
 Ord
 Updated
Sat, 12 Aug 2000
print 
Next page


parse_str

(PHP3 , PHP4 )

parse_str -- Parses the string into variables

Description

void parse_str (string str)

Parses str as if it were the query string passed via an URL and sets variables in the current scope.

Example 1. Using parse_str()


$str = "first=value&second[]=this+works&second[]=another";
parse_str($str);
echo $first;     /* prints "value" */
echo $second[0]; /* prints "this works" */
echo $second[1]; /* prints "another" */
      


User Contributed Notes: parse_str


skelly@juptech.com
26-Mar-2000 11:55
Damn! What a great function - but it doesn't work unless gpc_globals is enabled. I thinks this is a bug (or at least an undesirable feature)...


karme@unforgettable.com
28-Mar-2000 11:40
See also set_magic_quotes_runtime


karme@unforgettable.com
28-Mar-2000 11:48
If you use server authentication be careful with:
<PRE>parse_str(QUERY_STRING)</pre>
In fact you should always be careful with this one ;-)



greg@softhome.net
03-Aug-2000 08:51
to make a javascript style array, (as in):

<input type=text name="bla">
<input type=text name="bla">

instead of using <input name="bla"> use <input name="bla[]">.

This is also how you can add things to an array in php code, $bla[] = "hello"; $bla[] = "there"; returns an array bla ("hello","there")



 About Notes


Previous page
 Ord
 Updated
Sat, 12 Aug 2000
print 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.