Code:
$result = "Hello World";
$jsonEncodeValue = $result;
echo $jsonEncodedValue;
Assumed Output:
"Hello World"
Real Output:
\n"Hello World"
This \n Line Feed added automatically.
For this extra Line Feed my result breaks down while parsing through JSON parser. I am trying several hours to solve the issues.
I have checked at
- .htaccess is there any auto_prepend file exists which adds extra Line Feed, but not. I didn't get anything.
- Cgi-bin file is there any malicious code exists that adds extra Line Feed, but not. Didn't get anything.
My Question:
- Is someone injecting HTML or PHP code?
- If then, how to detect from where code injection is running (is there any way to find out from which file code injection is running) and how to prevent?