fscanf

It parses input from a file according to a format

Example

<?php

$fp = fopen(“test.txt”, “r”);

while ($data = fscanf($fp, “%tn%sn”)) {

list ($name, $profession, $countrycode) = $data;

}

fclose($fp);

?>

Share