阵列工具

将文本列表转换为 JS、Python、PHP、Perl、SQL IN 和 JSON 数组。

免费在线数组和列表转换器

将纯文本列表转换为您的项目需要的数组语法。 Dokall 支持 JavaScript、Python、PHP、Perl、SQL IN 子句和 JSON 数组 - 当您拥有电子表格中的列数据并需要代码就绪输出时,这是完美的选择。

每行粘贴一项并复制格式化结果。无需手动引用或括号括起来。

Frequently Asked Questions

What output formats are supported?
Dokall converts a line-separated list into JavaScript arrays, Python lists, PHP arrays, Perl arrays, SQL IN clauses, and JSON arrays. Each format handles quoting and escaping according to its language rules.
How does the SQL IN clause format work?
Each line becomes a quoted value inside parentheses: ('value1', 'value2', 'value3'). String values are single-quoted and internal quotes are escaped. Use this for WHERE column IN (...) queries when you have a list of IDs or names from a spreadsheet.
Are special characters escaped?
Yes. Quotes, backslashes, and other special characters in your input are escaped according to the target format. A line containing it's becomes "it's" in JavaScript and 'it\'s' in SQL.
Can I convert from an array back to lines?
This tool converts lines to arrays, not the reverse. To extract values from an existing array, use the JSON formatter to pretty-print it, then manually copy values, or use your language's join method programmatically.
One item per line - what about commas in values?
Each line is treated as one array element regardless of commas within the line. If your data uses commas as separators instead of newlines, paste into a spreadsheet first, then copy the column to get one value per line.