K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function returns the current element of an array? (A) current() (B) next() (C) key() (D) value() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) current() Explanation: current() returns the element at the current pointer position.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function advances the internal array pointer? (A) advance() (B) next() (C) forward() (D) move() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) next() Explanation: next() moves the pointer forward.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function moves the array pointer backward? (A) prev() (B) back() (C) previous() (D) rewind() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) prev() Explanation: prev() moves the internal pointer backward.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function returns the key of the current array element? (A) key() (B) index() (C) current_key() (D) array_key() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) key() Explanation: key() returns the key of the current element.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function checks if a value exists in an array? (A) array_key_exists() (B) in_array() (C) array_search() (D) value_exists() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) in_array() Explanation: in_array() checks for the presence of a value.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function searches a value and returns its key? (A) in_array() (B) array_key_exists() (C) array_search() (D) search_array() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) array_search() Explanation: array_search() returns the key if the value is found.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function counts occurrences of values in an array? (A) array_count() (B) count_values() (C) array_count_values() (D) value_count() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) array_count_values() Explanation: array_count_values() counts frequency of values.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function extracts variables from an array? (A) array_extract() (B) extract() (C) import() (D) vars() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) extract() Explanation: extract() imports array keys as variable names.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function compacts variables into an array? (A) array_pack() (B) compact() (C) collect() (D) vars_to_array() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) compact() Explanation: compact() creates an array from variables.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function delays execution for a number of seconds? (A) sleep() (B) wait() (C) pause() (D) delay() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) sleep() Explanation: sleep() delays execution in seconds.