Identify path slashes differently & drop PHP_EOL

Windows may use backslahes as it's dir seperator, but under some PHP
installs it uses the Linux forward slash instead. We could use the
directory seperator PHP var, but I've heard mixed opinions on this and
would rather just detect by looking at what $path, which contains
$docRoot, which is from the $_SERVER variable as this would be more
reliable.
It also wasn't showing the replace button due to a PHP_EOL which ended
the JS string with quote termination.