Skip to content

Instantly share code, notes, and snippets.

@rubo77
rubo77 / my_parse_str.php
Last active May 7, 2021 11:14 — forked from Shagshag/gist:5849065
This is a replacement for the original idea how to cirumvent the max_input_vars limitation, that uses the original parse_str() on each element of the query to parse
<?php
/**
* do the same than parse_str without max_input_vars limitation:
* Parses $string as if it were the query string passed via a URL and sets variables in the current scope.
* @param $string array string to parse (not altered like in the original parse_str(), use the second parameter!)
* @param $result array If the second parameter is present, variables are stored in this variable as array elements
* @return bool true or false if $string is an empty string
*
@rubo77
rubo77 / gist:6815165
Last active December 24, 2015 14:49 — forked from joshbmarshall/gist:6517321
The original Ghist didn't sent the correct result if an empty string is sent to the function. My edit sends an empty array as the original parse_str
<?php
/**
* do the same than parse_str without max_input_vars limitation
* @param $string array string to parse
* @return array query parsed
**/
function my_parse_str($string) {
if($string==='') return array();
$result = array();