@SheldonJul 31.2008 — #Yes, If you are just calling the function, you can do this as many times as required depending on the function. But we wont know unless we see the function.
But if you are talking about redefining the function itself, so stop and errors, you could wrap it in [url=http://php.net/function_exists]function_exists[url]
@kudzugazetteauthorJul 31.2008 — #Here is the code. They both are the same except for the directory they're listing. [code=php]<?php function DirDisply($data) {
@SheldonJul 31.2008 — #try this. Currently your proberly not getting any thing to show ?
[code=php] <?php // CHECK THAT FUNCTION IS NOT ALREADY DECLEARED if(!function_exists("DirDisply")){ // START FUNCTION function DirDisply($path){ // START OUTPUT $data = ""; // OPEN DIRECTORY $TrackDir=opendir($ptah); // CREATE AN ARRAY OF FILES NOT TO SHOW $badFiles = array(".",".."); // LOOP THROUGH DIRECTORY while ($file = readdir($TrackDir)) { // CHECK FILE NAME AGAIN BAD FILES. if(!in_array($file, $badFiles)){ // DEFINE FILE AND LINK $data .= "<li><a href='resources/facandstaffshow.php?page={$file}'>{$file}</a></li>n"; } } // CLOSE DIRECTORY closedir($TrackDir); // RETURN DATA return $data; } }
Do you know if there's a way to get the listings in reverse alphabetical order? I tried using preg_find but I couldn't do both at the same time and the links didn't work.