I'm building APIs using Laravel, and for some reason, the response generated seems to add a new line before returning the response. An example of this issue is explained in this link.
I suspect this is because there is an empty space or new line character before the opening tags in one of the PHP files. I was wondering what's the easiest way to find it? I use PHPStorm, and it has a regex search option. I am quite clueless as to how to use it to find the files though. Any ideas?
You could use \s+<\?php
. To remove the spaces, replace the matches with <?php
.