Page 295 - CITS - CSA - TP (Volume 1) - Hindi
P. 295
कंप्यूटर सॉफ्टवेयर एप्लीकेशन- CITS
अ ास 55: फ़ाइल बनाना और हटाना, टे फ़ाइलों को पढ़ना और िलखना, PHP म डायरे री
(िनद िशकाओं) के साथ काम करना, फ़ाइल के ए स की जाँच करना, फ़ाइल का
आकार िनधा रत करना, िलखने, पढ़ने या जोड़ने के िलए फ़ाइल ओपन करना, फ़ाइल म
डेटा िलखना, करै र रीड करना (Demonstrateon Creating and deleting a file,
Reading and writing text files, working with directories in PHP, checking
for existence of file, determining file size, opening a file for writing, reading,
or appending, Writing Data to the file Reading characters)
उ े
इस अ ास के अंत म आप यह कर सक गे
• PHP का उपयोग करके सव र म फ़ाइल /फ़ो र बनाना और िडलीट करना
• PHP का उपयोग करके टे फ़ाइल रीड करना और िलखना
• PHP का उपयोग करके फ़ाइल का आकार िनधा रत करना और फ़ाइल के ए स की जाँच करना।
आव कताएं (Requirements)
औजार/साम ी (Tools/Materials)
• लेटे कॉ फ़गरेशन वाला कं ूटर/लैपटॉप • PHP
• ऑपरेिटंग िस म: िवंडोज़ 10 या 11 • टे एिडटर
• Apache वेब सव र • वेब ाउज़र
ि या (Procedure)
टा 1: डायरे री (िनद िशका) के साथ काम करना
I डायरे री बनाना
1 टे एिडटर ओपन कर
2 िन िल खत कोड िलख
<html>
<body>
<?php
$directory_path = ‘example_directory ;
// Check if the directory doesn t exist before attempting to create
if (!is_dir($directory_path))
{
// Create the directory with mkdir()
mkdir($directory_path);
echo “Directory created successfully: $directory_path”;
}
else
279

