What PHP7 function is used to break a string into an array?
What PHP7 function is used to break a string into an array? was last modified: November 28th, 2018 by
1 Answers
Best Answer
If you need to break a string into an array, then you will want to use the explode() function. It is a binary safe function with a syntax as follows:
explode(separator,string,limit)
Keep in mind that the “separator” parameter must not be an empty string. The only optional parameter is the “limit” and it tells the number of array elements to return. The limit has three variations that can be used.
- Greater than 0 – Returns an array with a maximum of limit element(s)
- Less than 0 – Returns an array except for the last -limit elements()
- 0 – Returns an array with one element
Answer for What PHP7 function is used to break a string into an array? was last modified: November 28th, 2018 by