PHP Code Explode Multiple Delimiters or Characters

PHP Code on How to Split or Explode a String Using Multiple Character Separators

Home Short:

This simple one line of code allows you to explode a string in php into an array, specifying multiple delimiters in the explode function.

The multiple separators you want to use in the preg_split function get placed between the [ and the ], making sure to separate each delimiter with a pipe character |

In the above example we would split a string anywhere there is a period, question mark or exclamation point.

S
H
A
R
E