Is there a tool to format php pages nicely?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dwh
    Senior Member
    • Sep 2000
    • 1224
    • 3.0.0 Release Candidate 4

    Is there a tool to format php pages nicely?

    Ever get errors because while changing around your php file you had too many or too little tabs and ended ifs too soon or too late? Me too.

    Has anyone created a tool which knows all the php rules (including comments and "ifs" that end within one line like so

    PHP Code:
    if ($xyz=5$TUV=10
    )

    that will take a .php file and automatically insert the correct number of tabs so you can easily see where a function, if, else etc ends? If so, please let me know! I'd love to get one. Thank you.
  • Floris
    Senior Member
    • Dec 2001
    • 37767

    #2
    Don't use Dreamweaver or Frontpage to do the job, try to avoid notepad or wordpad too!

    You can use it, but it might change the code on itself.

    I advice using a text editor like UltraEdit, it has php highlighting which helps you overlook the source code. And it leaves the tabs,spaces and linewrapping in tact.

    Comment

    • dwh
      Senior Member
      • Sep 2000
      • 1224
      • 3.0.0 Release Candidate 4

      #3
      Originally posted by floris
      Don't use Dreamweaver or Frontpage to do the job, try to avoid notepad or wordpad too!

      You can use it, but it might change the code on itself.

      I advice using a text editor like UltraEdit, it has php highlighting which helps you overlook the source code. And it leaves the tabs,spaces and linewrapping in tact.
      I've been using Ultraedit for some time. It will make nice colors fitting php, true. But you can't push a button and have it add and remove tabs and whitespace from the "ifs" "elses" "cases" etc.

      Comment

      • Dean C
        Senior Member
        • Mar 2002
        • 4571
        • 3.5.x

        #4
        As long as you use ultraedit or editplus and programs like that then you don't ever have this problem Zend Studio seems pretty good too !
        Dean Clatworthy - Web Developer/Designer

        Comment

        • NTLDR
          Senior Member
          • Apr 2002
          • 212
          • 3.0.0 Gamma

          #5
          PHP Beautify will indent and make the code look like you want.
          vBulletin.org Moderator
          The Sisters Three Charmed Discussion Forums

          Comment

          • dwh
            Senior Member
            • Sep 2000
            • 1224
            • 3.0.0 Release Candidate 4

            #6
            Originally posted by NTLDR
            PHP Beautify will indent and make the code look like you want.
            Thnk you!

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...