Consider you are building a search functionality for your website. Which function would you use to determine if a particular keyword exists within a content string?
- strpos()
- str_replace()
- str_word_count()
- str_split()
The strpos() function is used to find the position of a substring (keyword) within a string. It returns the position or false if not found, making it suitable for searching within a content string.
Loading...
Related Quiz
- You are writing a PHP script and you need to define a trait. How would you do this?
- How can you prevent the inheritance of an exception class in PHP?
- How do you define an abstract class in PHP?
- What is the meaning of a final class and a final method?
- Which PHP function is used to check if a variable is of a specified type?