fix new line

This commit is contained in:
joyqi
2016-01-26 12:55:22 +08:00
parent 1c140a563a
commit 2200d86e8a
4 changed files with 20 additions and 8 deletions

13
tools/transfer-array.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
// transfer [] to array()
$file = $argv[1];
$text = file_get_contents($file);
$text = preg_replace("/= \[([^;]*)\];/s", "= array(\\1);", $text);
$text = preg_replace("/(\(| )\[([^\n]*?)\]\)/", "\\1array(\\2))", $text);
$text = preg_replace("/(\(| )\[([^\n]*?)\],/", "\\1array(\\2),", $text);
file_put_contents($file, $text);