+ Reply to Thread
Results 1 to 6 of 6

Thread: Remove Documentation PHP Script

  1. #1
    amr1991's Avatar
    amr1991 is offline x10 Sophmore amr1991 is an unknown quantity at this point
    Join Date
    Jul 2006
    Posts
    198

    Remove Documentation PHP Script

    Here is what I'm doing, I'm making a script that will take input of php code and then read through it and if any line starts with // it will erase the whole line. I only need to know if there is a function already to remove a line in PHP, or something of that sort





  2. #2
    Cynical's Avatar
    Cynical is offline Lord Of The Keys Cynical is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Massachusetts, USA
    Posts
    1,746

    Re: Remove Documentation PHP Script

    Nope, I haven't heard of anything like that... but remember: commenting is usually there for a reason. People don't just add it in randomly to bloat up their files.
    Seven: This rule is so underrated, keep your family and business completely separated.

  3. #3
    Torch's Avatar
    Torch is offline x10 Lieutenant Torch is an unknown quantity at this point
    Join Date
    Apr 2006
    Location
    Belgrade, Serbia
    Posts
    317

    Re: Remove Documentation PHP Script

    Actually, there's a php_strip_whitespace function which will remove whitespace and comments from a given php file. You can use it like this:
    PHP Code:
    <? php_strip_whitespace("somefile.php"?>
    For something more advanced you could use regexps (eg. ereg()) or maybe substr, in while loop. If you like I could make you a function like that, but I'm not sure if I'll have time in a next day or so. But, in any case I think that built in php_strip_whitespace function will suffice for what you need.

  4. #4
    Trixter is offline x10 Lieutenant Trixter is an unknown quantity at this point
    Join Date
    Oct 2006
    Posts
    384

    Re: Remove Documentation PHP Script

    Never heard of someone trying to get rid of commenting!!! lol

    but i suppose you could write a program to do it. or use GVIM to do it fast.
    Current:

    Latest:



  5. #5
    amr1991's Avatar
    amr1991 is offline x10 Sophmore amr1991 is an unknown quantity at this point
    Join Date
    Jul 2006
    Posts
    198

    Re: Remove Documentation PHP Script

    @Torch

    Torch you are a pro at PHP lol. Every reply you had for help with PHP for me worked

    @Trixter

    Thanks for the cool program :cool:





  6. #6
    Torch's Avatar
    Torch is offline x10 Lieutenant Torch is an unknown quantity at this point
    Join Date
    Apr 2006
    Location
    Belgrade, Serbia
    Posts
    317

    Re: Remove Documentation PHP Script

    I'm glad to be of help

+ Reply to Thread

Similar Threads

  1. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  2. tons of PHP Resources
    By Chris S in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 01-16-2009, 10:07 AM
  3. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM
  4. Notepad PHP Script
    By amr1991 in forum Scripts & 3rd Party Apps
    Replies: 12
    Last Post: 12-10-2006, 08:09 PM
  5. Need a PHP script
    By Woraug in forum Scripts & 3rd Party Apps
    Replies: 7
    Last Post: 07-15-2006, 06:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers