Converter
Paste SQL INSERT below, press Convert, and copy the PHP array output.
Convert SQL to PHP array free in your browser. Paste your SQL INSERT on the left, press Convert, and copy clean PHP array on the right. No sign-up, no uploads.
Paste SQL INSERT below, press Convert, and copy the PHP array output.
The parser reads each INSERT INTO statement, takes the column list in parentheses as the headers, then walks every VALUES tuple and pairs each value with its column. Quoted strings are unescaped, NULL becomes a true null, and numbers and booleans keep their types, so the PHP array output reflects the real data types instead of turning everything into text.
The snippet assigns $data, so rename the variable or wrap it in a return statement if you are building a config file. It is also a quick way to seed Laravel or WordPress fixtures: convert, paste into a seeder, and the nested array() syntax works on every supported PHP version.