PHP Tips

How to explode line breaks in PHP?

2017-07-13T13:52:56+00:00 By |PHP Tips|

The following code splits a given string by line-breaks and converts it into an array: $string_array = explode(PHP_EOL, $string); The function works properly when working on the server side. But, when we pass the string via AJAX to the serve the problem occurs: line breaks are not recognized properly. To overcome this problem instead [...]