Posted By

iloveitaly on 09/28/11


Tagged

php export var


Versions (?)

Format PHP Var Export


 / Published in: PHP
 

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

  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  

You need to login to post a comment.