PHP parse_str() Function

PHP ord() Function
PHP print() Function

what is the syntax of the PARSE_STR() function in php?

parse_str(string,array)
ParameterDescription
stringRequired. Specifies the string to parse
arrayOptional (Required from PHP 7.2). Specifies the name of an array to store the variables. This parameter indicates that the variables will be stored in an array.
PHP PARSE_STR() method

examples of the PARSE_STR() function

Examples 1. In this example, we parse a query string into variables.

<?php
parse_str("name=Peter&age=43");
echo $name."<br>";
echo $age;
?>

Example 2. Store the variables in an array:

<?php
parse_str("name=Peter&age=43",$myArray);
print_r($myArray);
?>
PHP ord() Function
PHP print() Function

Stay up-to-date about PHP!

We don’t spam!

en English
X
Scroll to Top