[ PHP Programming MCQS ]

झारखंड में आयोजित होने वाली JPSC, JSSC, JET, झारखंड पुलिस भर्ती परीक्षा आदि के लिए उपयोगी सामान्य अध्ययन।

[ PHP Programming MCQS ]

Useful GK for JPSC, JSSC, JET, Jharkhand Police and other exams.
691. Destructor method का नाम क्या है?
[A] __destruct()
[B] destructor()
[C] destroy()
[D] delete()
691. What is the destructor method name?
[A] __destruct()
[B] destructor()
[C] destroy()
[D] delete()
सही उत्तर: __destruct()
व्याख्या: Object destroy होने पर execute होता है।
Correct Answer: __destruct()
Explanation: Executes when object is destroyed.
692. Exception throw करने के लिए कौन-सा keyword उपयोग होता है?
[A] throw
[B] catch
[C] try
[D] exception
692. Which keyword is used to throw an exception?
[A] throw
[B] catch
[C] try
[D] exception
सही उत्तर: throw
व्याख्या: Exception raise करने के लिए।
Correct Answer: throw
Explanation: Raises an exception.
693. finally block कब execute होता है?
[A] Always
[B] Never
[C] Only on Exception
[D] Only on Success
693. When does finally block execute?
[A] Always
[B] Never
[C] Only on Exception
[D] Only on Success
सही उत्तर: Always
व्याख्या: Exception हो या न हो, finally execute होता है।
Correct Answer: Always
Explanation: Executes whether exception occurs or not.
694. PHP में count([1,2,3]) का output क्या होगा?
[A] 2
[B] 3
[C] 4
[D] 1
694. What is the output of count([1,2,3])?
[A] 2
[B] 3
[C] 4
[D] 1
सही उत्तर: 3
व्याख्या: Array elements की संख्या return करता है।
Correct Answer: 3
Explanation: Returns number of array elements.
695. array_push() का उपयोग किसलिए होता है?
[A] Array End में Element Add करना
[B] Beginning में Add करना
[C] Delete करना
[D] Sort करना
695. What is array_push() used for?
[A] Add element at array end
[B] Add at beginning
[C] Delete element
[D] Sort array
सही उत्तर: Array End में Element Add करना
व्याख्या: Array के अंत में values जोड़ता है।
Correct Answer: Add element at array end
Explanation: Adds values to the end of an array.
696. PHP में array_pop() क्या करता है?
[A] Last Element Remove करता है
[B] First Element Remove करता है
[C] Sort करता है
[D] Merge करता है
696. What does array_pop() do?
[A] Removes last element
[B] Removes first element
[C] Sorts array
[D] Merges array
सही उत्तर: Last Element Remove करता है
व्याख्या: Array के अंत का element remove करता है।
Correct Answer: Removes last element
Explanation: Removes the last element of an array.
697. array_shift() क्या करता है?
[A] First Element Remove करता है
[B] Last Element Remove करता है
[C] Array Reverse करता है
[D] Sort करता है
697. What does array_shift() do?
[A] Removes first element
[B] Removes last element
[C] Reverses array
[D] Sorts array
सही उत्तर: First Element Remove करता है
व्याख्या: Array के पहले element को remove करता है।
Correct Answer: Removes first element
Explanation: Removes the first element.
698. foreach loop किस data structure के लिए सबसे अधिक उपयोग होता है?
[A] Array
[B] Integer
[C] Boolean
[D] Float
698. Which data structure is foreach mostly used with?
[A] Array
[B] Integer
[C] Boolean
[D] Float
सही उत्तर: Array
व्याख्या: Arrays और iterable objects पर iterate करता है।
Correct Answer: Array
Explanation: Iterates over arrays and iterable objects.
699. implode() function क्या करता है?
[A] Array को String में Convert करता है
[B] String को Array में Convert करता है
[C] Array Sort करता है
[D] Array Reverse करता है
699. What does implode() do?
[A] Converts array to string
[B] Converts string to array
[C] Sorts array
[D] Reverses array
सही उत्तर: Array को String में Convert करता है
व्याख्या: Array elements को join करता है।
Correct Answer: Converts array to string
Explanation: Joins array elements.
700. PHP में include और require में मुख्य अंतर क्या है?
[A] require failure पर fatal error देता है
[B] include fatal error देता है
[C] दोनों समान हैं
[D] include script रोक देता है
700. What is the main difference between include and require?
[A] require gives fatal error on failure
[B] include gives fatal error
[C] Both are same
[D] include stops execution
सही उत्तर: require failure पर fatal error देता है
व्याख्या: include warning देता है जबकि require execution रोक सकता है।
Correct Answer: require gives fatal error on failure
Explanation: include gives warning while require may stop execution.