Converter to replace PHP short open tags (shorttags) with long tags

Click here to lend your support to: php_replace_short_tags and make a donation at www.pledgie.com !

[ PHP logo ]

This is a utility I wrote that converts PHP source that contains short open tags and replaces them with long tags.

i.e. it converts code like this:

<?= $var1 ?>
<? printf("%u changes\n",$changes) ?>

To this

<?php echo $var1 ?>
<?php printf("%u changes\n",$changes) ?>

The --skip-echo-tags option will cause it to skip <?= tags and only replace <? tags.

It’s written as a PHP-CLI script and needs the CLI php.ini file to be set to permit short short open tags. That’s the default setting for PHP 5.3.0 and earlier, but it might not always remain so. The program simply won’t change anything if the setting isn’t enabled.

Source

Related links:



Advertisement