Batch script to replace PHP short open tags with <?php

前端 未结 13 1872
轻奢々
轻奢々 2020-11-30 01:49

I have a large collection of php files written over the years and I need to properly replace all the short open tags into proper explicit open tags.

change \         


        
13条回答
  •  长情又很酷
    2020-11-30 02:33

    I used danorton script on almost 2000 files and it worked like a charm

    I put his script into a file named "fixtags.php" and used the following linux 1 liner to solve the problem:

    find . -iname "*.php" | xargs php fixtags.php --overwrite
    

    the only problem I had is when it encountered a file that was zero bytes in size.

提交回复
热议问题