Page 297 - CITS - CSA - TP (Volume 1) - Hindi
P. 297
कंप्यूटर सॉफ्टवेयर एप्लीकेशन- CITS
// Check if the directory exists before listing its contents
if (is_dir($directory_path))
{
// Open the directory
$directory_handle = opendir($directory_path);
// Read and display the contents
echo “Contents of $directory_path:\n”;
while (($file = readdir($directory_handle)) !== false)
{
echo $file . “\n”;
}
// Close the directory handle
closedir($directory_handle);
}
else
{
echo “Directory not found: $directory_path”;
}
?>
</body>
</html>
3 ो ाम को C:\Apache24\htdocs म .php ए ट शन वाले फ़ो र म सेव कर
4 Apache सिव स को िवंडोज़ सिव स से रन कर
5 ाउज़र ओपन कर और िन एड ेस िलख
http://localhost/foldername/
6 रन करने के िलए php फ़ाइल पर क कर और आउटपुट को वेरीफाई कर
281
CITS : IT & ITES - कं ूटर सॉ वेयर ए ीके शन - अ ास 55

