Format PHP Var Export


/ Published in: PHP
Save to your folder(s)

Format's var export so things looks a little bit nicer


Copy this code and paste it in your HTML
  1. function format_php_export($arrayRep) {
  2. $arrayRep = preg_replace('/[ ]{2}/', "\t", $arrayRep);
  3. $arrayRep = preg_replace("/\=\>[ \n\t]+array[ ]+\(/", '=> array(', $arrayRep);
  4. return $arrayRep = preg_replace("/\n/", "\n\t", $arrayRep);
  5. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.