What is difference between explode() or split() in PHP?
Answer / Alok Kumar Agmani
explode() and split() are both string-splitting functions in PHP, but they have some differences:
- explode() takes a delimiter as its first argument and returns an array of strings where the original string is split based on the delimiter. It is faster than split().
- split() also takes a delimiter, but it requires a regular expression pattern as its second argument and has optional third and fourth arguments to limit the number of splits and modify the behavior based on the delimiter found in the string. It is less efficient than explode(), especially for large strings.
| Is This Answer Correct ? | 0 Yes | 0 No |
Do while loops?
What is difference between static and constant?
What is php.ini & .htacess file?
hello.. i am b.tech 4th year student. i am confused that i should learning php or java. I have some knowledge of java and developed project in java, but i want to develop my career in php. So plz suggest me , i should go with php or java.
Does apache use php?
How does php serialize work?
What is exception in php?
What is an example of a variable?
Tell me what is the use of "enctype" attribute in a html form?
What is the use of Php variables?
Explain me soundex() and metaphone()?
Single choice objective PHP question...