Brand Logo

Website Coding Portal
HTML CSS & Script

Sawami Vivekanand
code
PHP include Function

✯ PHP में इन्क्लुड फंक्शन का इस्तेमाल करके बाह्य PHP फाइल के कंटेंट को किसी अन्य PHP फाइल में शामिल कर सकते हैं । उदाहरण के लिए यहाँ Website footer के लिए एक अलग PHP फाइल बनाते हैं जिसमें केवल फुटर पार्ट की सामग्री को लिखेंगे । इस फाइल का नाम footer.php रखेंगे जो कि आवश्यक नहीं है कि यहीं नाम रखे आप अपनी सुविधानुसार इस नाम को बदल के भी लिख सकते हैं ।

The contents of an external PHP file can be included in another PHP file by using the include function in PHP. For example, here we create a separate PHP file for the website footer, in which only the content of the footer part will be written. This file will be named footer.php, which is not necessary to keep the same name, you can change this name according to your convenience.

✧ PHP File (footer.php) ✧

Include Function की मदद से footer.php फ़ाइल को अन्य फाइल के फुटर सेक्शन में जोड़ेंगे जिससे footer.php फाइल के अंदर लिखी जानकारी दूसरे पेज के फुटर सेक्शन में शामिल हो जाएगी ।

✧ Include Function Structure ✧

✧ परिणाम ✧

This is a my website

i am php function use for footer part

This is a footer

include (" "); क्या है ?

✯ किसी PHP फाइल में लिखी जानकारी को अन्य PHP फाइल में शामिल करने के लिए PHP में इन्क्लुड फंक्शन का इस्तेमाल किया जाता हैं । इस फंक्शन में उद्धरण चिन्हों के मध्य उस PHP फाइल के नाम को लोकेशन सहित लिखा जाता हैं जिस फाइल को हम किसी पेज में शामिल करवाना चाहते हैं । यदि आपकी दोनों फाइल समान लोकेशन पर है तो उस स्थिति में इन्क्लुड फंक्शन में केवल उस फाइल का नाम ही लिखा जाता है जिसे आप अन्य पेज में शामिल करना चाहते हैं ।

The include function is used in PHP to include the information written in a PHP file in another PHP file. In this function, the name of that PHP file is written along with the location between the quotation marks which we want to include in a page. If both your files are at the same location, then in that case only the name of the file which you want to include in the other page is written in the include function.