The formating that you refer to the %s %i is actually the same as c formating in printf and scanf. this is what each one means.
%s - string
$d - Decimal value
%i - integer
%f - floating point number.
I asume the online doceumentation you are looking at is something like.
$fp = fopen ("users.txt","r");
while ($userinfo = fscanf ($fp, "%s\t%s\t%s\n")) {
list ($name, $profession, $countrycode) = $userinfo;
//... do something with the values
}
fclose($fp);
In this case the fscanf is saying it will accept a string then a tab another string and a tab and finally a string and a tab. this is put into the variable $userinfo.
A better example would be.
$fp = fopen ("users.txt","r");
while ( !feof($fp) )
{
list($in_num, $user_name) = fscanf ($fp, "%i%s\n")
}
fclose($fp);
This will accept a file that looks something like
00001 fred
00002 bill
00003 jane
it will read the file and store each line based on the data type. so after the first read $id_num will be "00001" and $user_name will be "fred".
You can see all the %s type things if you have a look on the help for sprintf.
Hope that helps.
Mark.