First GO!
Posted: Sun Oct 02, 2005 2:36 pm
Below is my first attempt at PHP with a lot of help from this forum and php.net, I want the PHP to check a directory called images and return a list. I also want the PHP to print out an Xml file to use in a flash document. (If I made sense:D ) My web hosts have Php 4.4.
Is this an efficent way to write / use Php?
Is this an efficent way to write / use Php?
Code: Select all
<?php
echo "<?xml version=\"1.0\"?>\n";
echo "<portfolio>\n";
$dh = opendir('images');
while (false !== ($file = readdir($dh))) {
if(strpos($file,'.')>0){
echo "<work" . " Url=\"images/".$file . "\" />\n";
}
}
echo "</portfolio>\n";
?>