You have a long string containing multiple words and you need to extract each word as an individual item in an array. Which PHP function would be most suitable for this task?

  • explode()
  • implode()
  • split()
  • preg_split()
The explode() function in PHP is used to split a string into an array based on a specified delimiter. This is ideal for separating words in a long string into individual array items.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *