davo666 wrote:what is $file???
in the example ShawnK posted, the $file is simply a pointer to each piece of the array is the "foreach" loops travels through each iteration...
$files = ftp_nlist();
foreach($files as $file)
{
echo "File: ". $file ."<br />";
}
the "foreach" loop will move from the beginning of the array to the end piece by piece, taking the piece as $file. This way, your code within the loop can operate individuall on $file and pull the information out of it. Basically, it lets you take the array of items you can create, and pull them out into a list.
you could add in table tags or link text etc. within the loop for more formatting options.
that probably didnt make much sense so if you have more questions just ask and let me try to clarify how i interpret it in my strange twisted mind...😉
even better, stop by over here...
http://www.php.net/manual/en/control-structures.foreach.php
good luck! 🙂