String Handling - searching, replacing, formatting, string library functions - Question Bank
1. Which function returns the string with all characters converted to lowercase?
2. What is the primary function of `str_replace()`?
3. Which function is used to remove characters from the beginning of a string?
4. What does `str_ireplace()` do?
5. Which function is used to get the length of a string in bytes?
6. What is the main difference between `strstr()` and `strchr()`?
7. Which function splits a string by another string?
8. What is the purpose of `str_pad()`?
9. Which function returns the string with the first character of the string capitalized?
10. What does `str_rot13()` do?
11. Which function returns the portion of a string starting from a specified offset up to a specified length?
12. The `substr_replace()` function can replace part of a string with another string. What is the default behavior if the length parameter is omitted?
13. Which function compares two strings using a 'natural order' algorithm?
14. What is the purpose of `strip_tags()`?
15. Which function returns the position of the last occurrence of a substring, ignoring case?
16. What does `str_contains()` check for?
17. Which function returns the string representation of a variable?
18. What is the primary role of `sscanf()`?
19. Which function is used to convert a string into an array by splitting it on lines?
20. What does `sha1()` generate?
21. Which function is used to get a substring of a string, starting from a specified offset and with a specified length, ignoring case?
22. What is the purpose of `str_repeat()`?
23. Which function returns a string, obtained by inserting a string into another string at a specified position?
24. What does `str_word_count()` return by default?
25. Which function is used to parse a string into variables?
26. The `str_ireplace()` function performs a case-insensitive version of which function?
27. Which function is used to find the position of the first occurrence of a substring, ignoring case?
28. What is the primary use of `str_shuffle()`?
29. Which function is used to get the length of a string in characters, supporting multi-byte encodings?
30. What does `levenshtein()` calculate?
31. Which function returns the string with the first character of each word capitalized?
32. The `wordwrap()` function in PHP is used to:
33. Which function translates or replaces characters in a string?
34. What is the output of `strrev('hello')`?
35. Which function compares two strings or parts of strings from a specified starting point?
36. The `substr_count()` function returns:
37. Which function returns the last occurrence of a substring in a string?
38. What is the purpose of `implode()` in PHP?
39. Which function removes whitespace from the beginning and end of a string?
40. To check if a string starts with a specific substring, which function is most suitable?
41. What does `md5()` function do in PHP?
42. Which function pads a string to a certain length with another string?
43. What is the difference between `strpos()` and `stripos()` in PHP?
44. Which function returns a part of a string, starting from a specified position?
45. The `str_split()` function in PHP divides a string into an array of:
46. Which PHP function converts a string to all uppercase letters?
47. What is the primary purpose of the `explode()` function in PHP?
48. Which function is used to replace all occurrences of a substring with another substring in PHP?
49. What does the PHP function `strlen()` return?
50. Which PHP function is used to find the position of the first occurrence of a substring within a string?