<h2>phptags</h2>

phptags is a simple command-line tool to automate the rewriting of PHP open and close tags.

  *  It can convert between short `<?` and long `<?php` open token.
  *  Add missing `?>` close tags.
  *  Excise <s>`?>`</s> close tags.
  *  Correct leading or trailing `␣` whitespace / UTF-8 BOM issues.

It utilizes either regex and/or the tokenizer.

<h3>project pages</h3>

  *  (updates)
  *  (download)
  *  (repository)
  *  (packages)

<h3>usage examples</h3>

  *  <b>phptags --whitespace *.php</b> cleans up spaces or UTF-8 BOM issues before opening and after close tags
  *  <b>phptags --warn searches through a directory and just warns about whitespace issues
  *  <b>phptags --close --long --tokenizer  *.php</b> adds close tags, converts open tags into long form &lt;?php and uses the more reliable --tokenizer mode (instead of --regex)
  *  <b>phptags --unclosed --shortall  dir/ ../*.tpl converts all tags into short forms, and strips close tags of a document (it's advised to rather have whitespace issues fixed than keep using the newcomer workaround)

See also <b>--help</b> or the [manpage] for the complete reference.