Created
April 10, 2012 19:21
-
-
Save augustohp/2353792 to your computer and use it in GitHub Desktop.
SQL formater for PHP by @alganet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function formatSql($sql) { | |
| return preg_replace( | |
| '/(select|from|(left |right |natural |inner |outer |cross |straight_)*join|where|limit|update |set|insert |values)/i', | |
| "\n$1\n ", str_replace("\n", '', $sql) | |
| ); | |
| } |
Util classes must die. If there's an Util class, everything else is Useless?
Author
LMAO
I said that because i know that you do not like. successful troll. (:
Author
Sure, we know... we know...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
put it in an utils class.