SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast laresistance2's Avatar
    Join Date
    May 2011
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How old code indenting

    Hello, I have very many PHP files that are indented badly and making the code less professional and difficult to read.

    So I'm looking for a script (bash, perl, etc..) That converts the code (class, function, etc..) With a standard indentation and beautiful.

    Thank you.

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Would you be manually selecting the code and hoping that a simple program that make it beautiful? If so, it looks like this script is a good option.
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  3. #3
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    2 Thread(s)
    Is all the old code indented differently or consistently? If consistently you can use search and replace and choose to remove x number of spaces? You might be able to use this approach in several passes?

    Otherwise in Eclipse the Opensource IDE for Java, PHP and other scriptable languages there is a plugin like HTML Tidy that works with PHP. You might want to give that a try if all else fails.

    Steve
    ictus==""


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •