PHP Interview Questions for Experience (अनुभव के लिए PHP साक्षात्कार प्रश्न)-
Question 1 – Please Define Magic method in PHP (कृपया पीएचपी में मैजिक विधि परिभाषित करें)?
Answer – A magic methods are special built-in methods that are called automatically when certain conditions are met in PHP (मैजिक मेथड्स विशेष अंतर्निहित विधियां हैं जो पीएचपी में कुछ शर्तें पूरी होने पर स्वचालित रूप से कॉल की जाती हैं).
Every magic method starts with a double underscore ( __ ) in PHP (पीएचपी में प्रत्येक मैजिक विधि डबल अंडरस्कोर ( __ ) से शुरू होती है).
PHP has several magic methods as (पीएचपी में कई मजिक मेथड हैं)-
- __construct()
- __set()
- __destruct()
- __debugInfo()
- __toString()
- __get() etc…
Question 2 – What are the different types errors in PHP (पीएचपी में विभिन्न प्रकार की त्रुटियाँ क्या हैं)?
Answer -PHP has main 3 types of errors given as follows (पी एच पी में मुख्यतः 3 प्रकार की त्रुटियाँ होती हैं जो इस प्रकार हैं)-
- Warning: In PHP, a warning is an error that is displayed to the programmer while the script is running (PHP में, चेतावनी एक त्रुटि है जो स्क्रिप्ट चलने के दौरान प्रोग्रामर को दिखाई जाती है).
- Notice: A notice is not error. It is not displayed to the programmer (सूचना त्रुटि नहीं है। यह प्रोग्रामर को प्रदर्शित नहीं होती).
- Fatal error: Fatal error is the most critical type of error. It will cause immediate termination of the script/program (घातक त्रुटि सबसे गंभीर प्रकार की त्रुटि है। इससे स्क्रिप्ट/प्रोग्राम तुरंत बंद हो जाएगा).
Question 3 – How will you get the IP address of user in PHP (पी एच पी में उपयोगकर्ता का आई पी पता कैसे प्राप्त करें)?
Answer – $_SERVER[‘REMOTE_ADDR’].
It is super global variable of PHP (यह पी एच पी का सुपर ग्लोबल वेरिएबल है।).
Question 4 – What do you understand about LAMP (आप एल ए एम पी के बारे में क्या समझते हैं)?
Answer – LAMP stand for Linux, Apache, MySQL and PHP. It is a Open Source Web Server for developing the web applications such as XAMPP (एल ए एम पी का मतलब है Linux, Apache, MySQL तथा पी एच पी। यह XAMPP जैसे वेब एप्लिकेशन विकसित करने के लिए एक ओपन सोर्स वेब सर्वर है).
Question 5 – How can you destroy the session and unset the variable of a session in PHP (पीएचपी में आप सत्र को कैसे नष्ट कर सकते हैं और सत्र के चर को कैसे अनसेट कर सकते हैं)?
Answer –
<?php
session_destroy(); // destroy session
session_unset(); // remove all session variables
?>Question 6 – How will you submit form without a submit button (सबमिट बटन के बिना आप फॉर्म कैसे सबमिट करेंगे)?
Answer – Using JavaScript code, we can call the document.form.submit() function to submit the form (जावास्क्रिप्ट कोड का उपयोग करके, हम फॉर्म सबमिट करने के लिए document.form.submit() फ़ंक्शन को कॉल कर सकते हैं).
Question 7 – What are the different type of tables in MySQL (MySQL में विभिन्न प्रकार की तालिकाएँ क्या हैं)?
Answer –
- MyISAM
- Merge
- Heap
- InnoDB
- BDB
- ISAM
Question 8 – How can you enable error reporting in PHP (आप पीएचपी में त्रुटि रिपोर्टिंग कैसे सक्षम कर सकते हैं)?
Answer –
- First we check “display_errors” is “on” in the php.ini or
- declare “ini_set(‘display_errors’, 1)” in our script.
- Then, include “
error_reporting(E_ALL)” in your code.
The above code will display all types of error messages (उपरोक्त कोड सभी प्रकार के त्रुटि संदेश प्रदर्शित करेगा).
Question 9 – You can change the value of a constant during the script’s execution (आप स्क्रिप्ट के निष्पादन के दौरान किसी स्थिरांक का मान बदल सकते हैं)?
Answer – No, A constant value cannot change if it’s declared during the PHP execution (नहीं, यदि पीएचपी निष्पादन के दौरान स्थिर मान घोषित किया जाता है तो वह परिवर्तित नहीं हो सकता).
Question 10 – How can you get the number of elements in an array (आप किसी सरणी में तत्वों की संख्या कैसे प्राप्त कर सकते हैं)?
Answer – Using count() function (गिनती() फ़ंक्शन का उपयोग करना)-
<?php
$names=array("Ashok","Shivam","Haq"); // array
echo count($names); // the output is 3
?>Top 20 jQuery Interview Questions and Answers…
PHP Interview Questions for 3 Years Experience
Tags: 3 Years Experience Questions PHP, PHP Interview Questions and Answer, PHP Interview Questions for 3 Years Experience, PHP Interview Questions for Experience
