Beautify PHP

version 0.5.0, 08.05.2003

Home
Example
Online Demo
Download
Donate
Forum
Change Log
To Do
Links
License
Contact
Copyright
© 2002-2006
Jens Bierkandt
 
Sponsored by:
Online coding tools
SourceForge.net Logo

Example:

The following code example is part of the beautifier. First, you see some code obscured with POBS:

<?for ($i=0;$i<strlen($str);$i++) {if ($new_line_counter==0) {if (($i+1)<sizeof($a)) {if ($a[$i+1]=="?" AND $a[$i]=="<") {out($outstr);out("<?php");$indent++;$new_line_counter++;if (($i+4)<sizeof($a)) {if ($a[$i+2]=="p" AND $a[$i+3]=="h" AND $a[$i+4]=="p") $i=$i+3;}$i++;continue;}else {$outstr.=$a[$i];continue;}}}};?>

The code from above beautified by Beautify PHP with default values:

<?php
   
for ($i 0$i strlen($str); $i++) {
      if (
$new_line_counter == 0) {
         if ((
$i+1) < sizeof($a)) {
            if (
$a[$i+1] == "?" AND $a[$i] == "<") {
               
out($outstr);
               
out("<?php");
               
$indent++;
               
$new_line_counter++;
               if((
$i+4) < sizeof($a)) {
                  if (
$a[$i+2] == "p" AND $a[$i+3] == "h" AND $a[$i+4] == "p")
                  
$i $i+3;
               }
               
$i++;
               continue;
            } else {
               
$outstr .= $a[$i];
               continue;
            }
         }
      }
   };
?>