Join Up!
104887 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousordprintnext
Last updated: Tue, 28 May 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | German | Spanish

parse_str

(PHP 3, PHP 4 >= 4.0.0)

parse_str -- Parses the string into variables

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 an array elements instead.

Huomaa: Support for the optional second parameter was added in PHP 4.0.3.

Esimerkki 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" */

See also set_magic_quotes_runtime() and urldecode().

User Contributed Notes
parse_str
add a note about notes
There are no user contributed notes for this page.
previousordprintnext
Last updated: Tue, 28 May 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST