Recreate original PHP array from print_r output [duplicate]
function print_r_reverse($in) { $lines = explode(“\n”, trim($in)); if (trim($lines[0]) != ‘Array’) { // bottomed out to something that isn’t an array return $in; } else { // this is an array, lets parse it if (preg_match(“/(\s{5,})\(/”, $lines[1], $match)) { // this is a tested array/recursive call to this function // take a set of spaces … Read more