Skip to content

Commit c301ce7

Browse files
authored
Create convert.php
1 parent 831272b commit c301ce7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

convert.php

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
// $function="\twrite(output, ";
3+
$function="\tprintf(\"%s\", ";
4+
$input=file_get_contents("input.txt");
5+
$lines=explode("\n", $input);
6+
foreach($lines as $line) {
7+
$line=str_replace(" ", "\\t", $line);
8+
$line=str_replace("\"", "\\\"", $line);
9+
print $function."\"".$line."\\n\");\n";
10+
}

0 commit comments

Comments
 (0)