Page 307 - CITS - CSA - TP (Volume 1) - Hindi
P. 307
कंप्यूटर सॉफ्टवेयर एप्लीकेशन- CITS
<?php
$file= my_new_file.txt ;
if(file_exists($file))
{
$content=file_get_contents($file) or die(“Error file opening not possible “);
echo $content;
}
else
{
echo “ERROR: File does not exist.”;
}
?>
</body>
</html>
3 ो ाम को C:\Apache24\htdocs म .php ए ट शन वाले फ़ो र म सेव कर ए ट शन
4 िवंडोज सिव स से Apache सिव स रन कर
5 ाउज़र ओपन कर और िन एड ेस टाइप कर
http://localhost/foldername/
6 रन करने के िलए php फ़ाइल पर क कर और आउटपुट वेरीफाई कर
II फ़ाइल फ़ं न का उपयोग करके करै र रीड करना
1 टे एिडटर ओपन कर
2 िन कोड िलख
<html>
<body>
<?php
$file=”example.txt”;
if(file_exists($file))
{
$content=file($file) or die(“Error file opening not possible “);
291
CITS : IT & ITES - कं ूटर सॉ वेयर ए ीके शन - अ ास 55

