Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
Cata M #1
help neded
i have build up this php, wich enters in a specific path and creates an array
that contains all the names of the files from that specific path. the variables
obtained here will to be loaded by swf. i need to know if what i have done is
good.
<?php
$a=1;
// this function constructs $img array, that contain the name of the pictures
in the $current_dir
//in the final version the current dir whil by dynamicaly asigned
function construct_array()
{ $current_dir = 'c:\inetpub\wwwroot\xxx\pictures';
$dir = opendir($current_dir);
$i = -1;
while ($file = readdir($dir))
{
$i++;
$img[$i] = $file;
}
closedir($dir);
return $img;
};
// this function returns the length of the above array
function array_length()
{
$img = construct_array();
$i = 0;
while ($img[$i]!='')
{
$i++;
};
$l = $i-1;
return $l;
};
//$picture is the array that contains the name of the pictures from
$current_dir
//this variable will be passed to flash
$pictures = construct_array();
//$length is the length of $pictures array
//this variable will be passed to flash
$length = array_length();
?>
Cata M Guest



Reply With Quote

