I use this snippet of code to make an array of a folde with pictures. Lateron I use the array to do some magic random stuff choosing a few of the pics for display. This is the snippet:
$handle = opendir('../images/zijpanelen');
while (false !== ($file = readdir($handle)))
{
$picArray[] = $file;
};
closedir($handle);
Now the funny part is, at times there is no picture chosen. The reason: it sees the parent folder as a file and so as a pic. The relative URL of the pic becomes
'../images/zijpanelen/..
For some website I took some code I wrote a while back (some years). I was pleasantly surprised by what I made in the dark ages. Some nifty work arounds in a programming language I barely knew. I needed to do a lot of cleening up though. And I wonder why I left the database connection info in a plain text file?
i'm not sure if you're asking a question, but the answer is :
¥