K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function reverses an array? (A) array_flip() (B) array_reverse() (C) array_swap() (D) array_sort() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) array_reverse() Explanation: array_reverse() reverses array order.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function flips array keys and values? (A) array_reverse() (B) array_change_key_case() (C) array_flip() (D) array_swap() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) array_flip() Explanation: array_flip() swaps keys and values.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function removes duplicate values from an array? (A) array_unique() (B) array_distinct() (C) unique_array() (D) array_remove_duplicates() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) array_unique() Explanation: array_unique() removes duplicate values.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function joins array elements into a string? (A) join() (B) implode() (C) Both join() and implode() (D) concat() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) Both join() and implode() Explanation: join() is an alias of implode().
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function escapes HTML characters? (A) htmlspecialchars() (B) strip_tags() (C) htmlentities() (D) escape_html() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) htmlspecialchars() Explanation: htmlspecialchars() prevents XSS by escaping HTML.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. What will be the output of: var_dump(false == 0); (A) true (B) false (C) 0 (D) Error 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) true Explanation: Loose comparison converts false to 0.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. What will be the output of: var_dump(false === 0); (A) true (B) false (C) 0 (D) Error 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) false Explanation: Strict comparison checks both value and type.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP construct is faster than calling a function? (A) print (B) echo (C) printf (D) var_dump 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) echo Explanation: echo is a language construct and faster than functions.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function returns the last element of an array without removing it? (A) end() (B) array_last() (C) array_pop() (D) last() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) end() Explanation: end() moves the internal pointer to the last element.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function resets the internal pointer of an array? (A) reset() (B) rewind() (C) start() (D) first() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) reset() Explanation: reset() sets the array pointer to the first element.