Format MySQL code inside PHP string

后端 未结 16 1817
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-04 00:29

Is there any program IDE or not that can format MySQL code inside PHP string e.g. I use PHPStorm IDE and it cannot do it.

It does that for PHP and MYSQL but not for MYS

16条回答
  •  余生分开走
    2021-02-04 01:04

    You can use the tokenizer extension to write a script that would format the SQL.

    The following script can be invoked from the command-line, it reads from standard input and writes to standard output. It handles both quoting styles (double or single quotes).

    All strings are scanned for possible SQL grammar, based on the starting word, and line breaks are inserted before every keyword; both starting word and keywords are extensible, so go wild :)

提交回复
热议问题