}
// All (maybe) fine so remove the response header from server
- $response = $response[(count($response) - 1)];
+ for ($idx = (count($response) - 1); $idx > 1; $idx--) {
+ $line = trim($response[$idx]);
+ if (!empty($line)) {
+ $response = $line;
+ break;
+ }
+ }
// Prepare the returning result for higher functions
if (substr($response, 0, 1) == '&') {