PHP strrev wordwrap str_split Quiz — 15 Questions
PHP String Functions Quiz हिंदी में — strrev, str_word_count, wordwrap, chunk_split, str_split से जुड़े 15 important questions real examples के साथ। BCA, MCA, BSc students के लिए।
-
strrev("Hello") का output क्या होगा?
- olleH
- Hello
- HELLO
- Error आएगी
-
strrev() function किसके लिए सबसे common interview question है?
- Palindrome check करने के लिए
- String की length निकालने के लिए
- String को uppercase करने के लिए
- Array sort करने के लिए
-
str_word_count($text, 1) से क्या return होता है?
- Words की indexed array — जैसे [0=>"Hello", 1=>"World"]
- Words की सिर्फ total count (integer)
- Words की positions के साथ array
- String की length
-
str_word_count() का default mode (format = 0) क्या return करता है?
- Words की total count (integer)
- Words का array
- Words की positions
- हमेशा 0
-
wordwrap() function का default width कितना होता है?
- 75 characters
- 50 characters
- 100 characters
- 30 characters
-
wordwrap() किस चीज़ के लिए best है — HTML में लाइन ब्रेक दिखाने के लिए?
- wordwrap($text, 40, "<br>") use करना
- wordwrap($text, 40, "\n") use करना
- wordwrap हमेशा HTML tags automatically लगाता है
- wordwrap() HTML के लिए use नहीं हो सकता
-
wordwrap() और nl2br() में क्या फर्क है?
- wordwrap() defined width पर line breaks add करता है; nl2br() existing \n को <br> में convert करता है
- दोनों बिल्कुल same काम करते हैं
- wordwrap() सिर्फ numbers के लिए है
- nl2br() words को wrap करता है
-
chunk_split("ABCDEFGHI", 3, "-") का output क्या होगा?
- ABC-DEF-GHI-
- ABCDEFGHI
- A-B-C-D-E-F-G-H-I
- ABC-DEF-GHI
-
chunk_split() का default separator क्या होता है?
- \r\n (carriage return + newline)
- Space
- Comma
- Dash (-)
-
Credit card number को 4111-1111-1111-1234 format में दिखाने के लिए कौन सा function best है?
- chunk_split() — हर 4 chars के बाद separator डालने के लिए
- wordwrap() — words wrap करने के लिए
- str_word_count() — words count करने के लिए
- strrev() — string reverse करने के लिए
-
str_split("Hello") (बिना length parameter के) का output क्या होगा?
- Array([0]=>H [1]=>e [2]=>l [3]=>l [4]=>o) — हर character अलग
- Array([0]=>"Hello") — पूरी string एक element में
- "Hello" — string ही return होगी
- Error आएगी
-
str_split("Hello", 2) का output क्या होगा?
- Array([0]=>He [1]=>ll [2]=>o)
- Array([0]=>H [1]=>e [2]=>l [3]=>l [4]=>o)
- Array([0]=>Hello)
- Error आएगी क्योंकि length 5 से divide नहीं होता
-
str_split() और explode() में मुख्य फर्क क्या है?
- str_split() fixed size से split करता है; explode() किसी delimiter character से split करता है
- str_split() string return करता है; explode() array return करता है
- दोनों बिल्कुल same काम करते हैं
- explode() सिर्फ numbers के लिए है
-
chunk_split() और wordwrap() में क्या फर्क है?
- chunk_split() हर N characters के बाद separator डालता है (words ignore करके); wordwrap() word boundaries respect करता है
- दोनों बिल्कुल same काम करते हैं
- chunk_split() सिर्फ HTML के लिए है
- wordwrap() सिर्फ numbers format करता है
-
$letters = str_split("abcdefghij"); shuffle($letters); — यह code क्या करता है?
- String के सभी characters को random order में shuffle करता है
- String को alphabetically sort करता है
- String को reverse करता है
- Error देता है क्योंकि shuffle() strings पर काम नहीं करता