I would like to explode a string (separated based on a delimiter and placed into an array), using both a space (" ") and a newline ("\n") as a delimiter.

The method (which I don't think is the best way) is to:

  1. Explode the array by spaces
  2. Remake the string from the array
  3. Explode it again for new lines
  4. MySQL escape the individual elements.

Question: How do I exploded a string by both a space and new line?

Reference to: new line Array

Edit
Report