$fh = fopen("data.txt", "r"); while ($user = fscanf($fh, "%d-%d-%d")) { list ($part1,$part2,$part3) = $user; print $part1; print $part2; print $part3; } fclose($fh);?>