« पीछे | PHP Require Function | आगे » |
---|
✯ PHP में Require Function भी Include Function की तरह एक PHP फ़ाइल को दूसरी PHP फाइल के साथ लिंक करने का काम करता हैं । इस फंक्शन का उपयोग करके किसी फाइल में लिखे कंटेंट को दूसरी फाइल में प्रदर्शित करवाया जाता हैं जिस फाइल में वह PHP फाइल लिंक की जाती हैं ।
Require Function in PHP also works like Include Function to link one PHP file with another PHP file. Using this function, the content written in a file is displayed in another file in which the PHP file is linked.
✯ यह Include Function से कुछ भिन्न हैं । यदि Require Function का उपयोग करके किसी पेज में अन्य कोई दूसरी PHP फाइल को सम्मिलित किया जाता हैं लेकिन गलती से Require Function में उस फाइल की लोकेशन या फ़ाइल का नाम गलत लिख दिया जाता हैं तो यह फंक्शन उसी स्थान तक उस फाइल की सामग्री को लोड करेगा जिस स्थान पर आप Require Function का इस्तेमाल करेंगे ।
It is somewhat different from Include Function. If any other PHP file is included in a page using Require Function, but by mistake the location or name of that file is written wrongly in Require Function, then this function will load the contents of that file till the same location. Will do at the place where you will use Require Function.
✯ Require Function के उपयोग से पूर्व वेबसाइट हैडर के लिए अलग से एक PHP फाइल बनाते हैं जिसका नाम header.php रख रहे हैं ।
Before using the Require Function, create a separate PHP file for the website header, named header.php.
✯ Require Function की मदद से header.php फ़ाइल को अन्य फाइल के हैडर सेक्शन में जोड़ेंगे जिससे header.php फाइल के अंदर लिखी जानकारी दूसरे पेज के हैडर सेक्शन में शामिल हो जाएगी ।
With the help of Require Function, the header.php file will be added to the header section of the other file, so that the information written inside the header.php file will be included in the header section of the other page.
✯ जैसा की आप देख पा रहे हैं की यहाँ पर Require Function में फाइल का नाम गलती से header.php के स्थान पर myheader.php लिख दिया, जिसके कारण इस फंक्शन ने बाकि पेज को लोड भी नहीं किया ।
As you can see, here in the Require Function, the name of the file was mistakenly written instead of header.php, myheader.php, due to which this function did not even load the rest of the page. Now using Include Function instead of Require Function, let's see if there is any difference.
✯ अब Require Function के स्थान पर Include Function का इस्तेमाल करके देखते हैं कि क्या कुछ अंतर देखने को मिलता हैं ।
i am php function use for header part
✯ Include Function ने हैडर फ़ाइल का नाम गलत लिखा हुआ होने के बावजूद हैडर फाइल को लोड नहीं किया लेकिन बाकि पेज में लिखी सभी जानकारी लोड कर दी तथा उसके परिणाम को प्रदर्शित कर दिया ।
✯ Require और Include Function के मध्य अंतर को जानने के बाद अब Require Function में सही फ़ाइल नाम का उपयोग करके परिणाम को देखने का प्रयास करते हैं ।
The Include Function did not load the header file despite the name of the header file being misspelled but loaded all the information written in the rest of the page and displayed its result. After knowing the difference between Require and Include Function, now let us try to see the result by using correct file name in Require Function.
i am php function use for header part
Require(" "); क्या है ?✯ Require भी Include Function की तरह PHP का एक फंक्शन हैं जिसकी मदद से किसी PHP फाइल को अन्य PHP फाइल में लिंक किया जाता हैं तथा एक PHP फाइल के अंदर लिखी जानकारी को दूसरी PHP फाइल में शामिल कर सकते हैं । इस फंक्शन के उद्धरण चिह्न के मध्य उस फाइल का नाम व पता लिखा जाता हैं जिस फ़ाइल के कंटेंट को अन्य PHP फाइल में शामिल करना चाहते हैं ।
Require is also a function of PHP like Include Function, with the help of which a PHP file is linked to another PHP file and the information written inside one PHP file can be included in another PHP file. The name and address of that file are written between the quotation marks of this function whose contents are to be included in the other PHP file.