[ PHP Programming MCQS ]
झारखंड में आयोजित होने वाली JPSC, JSSC, JET, झारखंड पुलिस भर्ती परीक्षा आदि के लिए उपयोगी सामान्य अध्ययन।
[ PHP Programming MCQS ]
Useful GK for JPSC, JSSC, JET, Jharkhand Police and other exams.
201. PHP में print और echo में मुख्य अंतर क्या है?
[A] कोई अंतर नहीं
[B] print value return करता है
[C] echo value return करता है
[D] दोनों array return करते हैं
201. What is the main difference between print and echo?
[A] No difference
[B] print returns a value
[C] echo returns a value
[D] Both return arrays
सही उत्तर: print value return करता है
व्याख्या: print 1 return करता है जबकि echo return नहीं करता।
Correct Answer: print returns a value
Explanation: print returns 1 while echo does not return.
202. PHP में isset() function क्या जांचता है?
[A] Variable declared है और NULL नहीं है
[B] Variable integer है
[C] Variable string है
[D] Variable array है
202. What does isset() check?
[A] Variable exists and is not NULL
[B] Variable is integer
[C] Variable is string
[D] Variable is array
सही उत्तर: Variable declared है और NULL नहीं है
व्याख्या: Variable existence और non-null value check करता है।
Correct Answer: Variable exists and is not NULL
Explanation: Checks variable existence and non-null value.
203. empty() function कब true return करता है?
[A] Value 0 हो
[B] Value NULL हो
[C] Value empty string हो
[D] उपरोक्त सभी
203. When does empty() return true?
[A] Value is 0
[B] Value is NULL
[C] Value is empty string
[D] All of these
सही उत्तर: उपरोक्त सभी
व्याख्या: 0, NULL, "", false आदि पर true return करता है।
Correct Answer: All of these
Explanation: Returns true for 0, NULL, "", false etc.
204. PHP में die() function का उपयोग किसलिए किया जाता है?
[A] Loop चलाने के लिए
[B] Script terminate करने के लिए
[C] Array बनाने के लिए
[D] Session delete करने के लिए
204. What is die() used for in PHP?
[A] Run Loop
[B] Terminate Script
[C] Create Array
[D] Delete Session
सही उत्तर: Script terminate करने के लिए
व्याख्या: Script execution तुरंत रोक देता है।
Correct Answer: Terminate Script
Explanation: Stops script execution immediately.
205. PHP में exit() और die() में क्या अंतर है?
[A] बहुत बड़ा अंतर
[B] कोई अंतर नहीं
[C] exit तेज है
[D] die तेज है
205. What is the difference between exit() and die()?
[A] Major difference
[B] No difference
[C] exit is faster
[D] die is faster
सही उत्तर: कोई अंतर नहीं
व्याख्या: दोनों समान कार्य करते हैं।
Correct Answer: No difference
Explanation: Both perform the same function.
206. PHP में error suppression operator कौन-सा है?
[A] #
[B] @
[C] $
[D] %
206. Which is the error suppression operator in PHP?
[A] #
[B] @
[C] $
[D] %
सही उत्तर: @
व्याख्या: Error messages को suppress करता है।
Correct Answer: @
Explanation: Suppresses error messages.
207. PHP में require_once का मुख्य लाभ क्या है?
[A] File बार-बार include होती है
[B] File केवल एक बार include होती है
[C] Database connect करता है
[D] Session create करता है
207. What is the main advantage of require_once?
[A] Includes file multiple times
[B] Includes file only once
[C] Connects database
[D] Creates session
सही उत्तर: File केवल एक बार include होती है
व्याख्या: Duplicate inclusion रोकता है।
Correct Answer: Includes file only once
Explanation: Prevents duplicate inclusion.
208. PHP में include_once का उद्देश्य क्या है?
[A] File एक बार include करना
[B] File delete करना
[C] File rename करना
[D] File compress करना
208. What is the purpose of include_once?
[A] Include file once
[B] Delete file
[C] Rename file
[D] Compress file
सही उत्तर: File एक बार include करना
व्याख्या: Duplicate loading से बचाता है।
Correct Answer: Include file once
Explanation: Prevents duplicate loading.
209. यदि mysqli_connect() fail हो जाए तो error प्राप्त करने के लिए कौन-सा function प्रयोग होता है?
[A] mysqli_error()
[B] mysqli_connect_error()
[C] db_error()
[D] connect_error()
209. Which function returns MySQL connection errors?
[A] mysqli_error()
[B] mysqli_connect_error()
[C] db_error()
[D] connect_error()
सही उत्तर: mysqli_connect_error()
व्याख्या: Connection errors के लिए।
Correct Answer: mysqli_connect_error()
Explanation: Used for connection errors.
210. PHP में header() function का उपयोग किसलिए किया जाता है?
[A] HTML Print
[B] HTTP Headers भेजने के लिए
[C] Database Query
[D] Session Start
210. What is header() function used for?
[A] Print HTML
[B] Send HTTP Headers
[C] Database Query
[D] Start Session
सही उत्तर: HTTP Headers भेजने के लिए
व्याख्या: Redirect और content-type के लिए।
Correct Answer: Send HTTP Headers
Explanation: Used for redirects and headers.