- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
parse_str() function in PHP
The parse_str() function is used to parse the string into variables. It returns nothing.
Syntax
parse_str(str, arr)
Parameters
str − The string to pass
arr − The name of an array to store the variables
Return
The parse_str() function returns nothing.
Example
The following is an example −
<?php parse_str("studentname=Jack&marks=95",$arr); print_r($arr); ?>
Output
The following is the output −
Array ( [studentname] => Jack [marks] => 95 )
Example
Let us see another example −
<?php parse_str("studentname=Tom&studentmarks=95&studentsubject=Maths", $arr); print_r($arr); ?>
Output
The following is the output −
Array ( [studentname] => Tom [studentmarks] => 95 [studentsubject] => Maths )
Advertisements