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

前端 未结 13 1845
轻奢々
轻奢々 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:39

    I had the same problem when I update php version.

    Use this:

    find . -iname "\*.ph\*" -type f -print0 |xargs -0 sed -i -e 's/

    This will convert "" to ""

    for any kind of file .php or .phtml

    Credits: https://coderwall.com/p/cnm0_w/replace-php-short-open-tags-with-full-form-in-all-php-files-using-one-command

提交回复
热议问题