- fscanf: documentation ( source)
- fclose: documentation ( source)
- fwrite: documentation ( source)
- fopen: documentation ( source)
- file_exists: documentation ( source)
<?php
$fname = '/tmp/graci.txt';
$fp = fopen($fname, file_exists($fname) ? 'a+' : 'w+');
$in = "graci|senha|rg|cpf\n";
fwrite($fp, $in);
while ($user = fscanf($fp, "%s|%s\n")) {
echo $user;
}
fclose($fp);