- fscanf: documentation ( source)
- var_dump: documentation ( source)
- feof: documentation ( source)
- fwrite: documentation ( source)
- fseek: documentation ( source)
- fopen: documentation ( source)
<?php
$fp = fopen('php://temp', 'wb+');
fwrite($fp, "move 19 from 23 to 34\n\n");
fseek($fp, 0);
while (!feof($fp)) {
if (!fscanf($fp, "move %d from %d to %d\n", $howMany, $from, $to))
unset($howMany, $from, $to);
var_dump($howMany, $from, $to);
}