refactor(lvl06/ressources): adding the php formatted
This commit is contained in:
parent
f05354f79d
commit
59e6e6d927
1 changed files with 20 additions and 0 deletions
20
level06/ressources/level06.php
Executable file
20
level06/ressources/level06.php
Executable file
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!/usr/bin/php
|
||||||
|
<?php
|
||||||
|
function y($m)
|
||||||
|
{
|
||||||
|
$m = preg_replace("/\./", " x ", $m);
|
||||||
|
$m = preg_replace("/@/", " y", $m);
|
||||||
|
return $m;
|
||||||
|
}
|
||||||
|
|
||||||
|
function x($y, $z)
|
||||||
|
{
|
||||||
|
$a = file_get_contents($y);
|
||||||
|
$a = preg_replace("/(\[x (.*)\])/e", "y(\"\\2\")", $a);
|
||||||
|
$a = preg_replace("/\[/", "(", $a);
|
||||||
|
$a = preg_replace("/\]/", ")", $a);
|
||||||
|
return $a;
|
||||||
|
}
|
||||||
|
$r = x($argv[1], $argv[2]);
|
||||||
|
pr $r;
|
||||||
|
?>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue