• PHP Video Tutorials

PHP - Function parse str



Syntax

void parse_str ( string $str [, array &$arr ] )

Definition and Usage

It is used to parses the string into variables

Return Values

No value is returned

Parameters

Sr.No Parameters & Description
1

str

It is the string input

2

array

It specifies the name of an array to store the variables.

Example

Try out the following example

<?php
   parse_str("name=Gopal K Verma&age=45");
   
   echo $name."<br>";
   echo $age;
?>

This will produce following result −

Gopal K Verma
45
php_function_reference.htm
Advertisements