Skip to content

Instantly share code, notes, and snippets.

@mahadazad
Created July 13, 2013 21:45
Show Gist options
  • Save mahadazad/5992341 to your computer and use it in GitHub Desktop.
Save mahadazad/5992341 to your computer and use it in GitHub Desktop.
Extract MySQL queries to PHP arrays.
preg_match_all('/^(?:UPDATE|SELECT|INSERT INTO|CREATE).*;$/smU', file_get_contents('dump.sql'), $matches);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment