In the PHP curl_multi_exec manual, a strange 3 loops are given as an example:
|
|
In the PHP curl_multi_exec manual, a strange 3 loops are given as an example:
|
|
If anything else doesn’t work, try this sample code:
|
|
/**
* Clean duplicates new line
*
*/
function cleanNewLine($text) {
$newLine = "\r\n";
$strRes = '';
$posNewLine = strpos($text, $newLine);
if ($posNewLine===false) {
$strRes = $text;
} else {
$startText = substr($text, 0, $posNewLine+2);
$endText = substr($text, $posNewLine+2);
$strRes .= $startText."";
// Remove duplicate new line if exists
$posNewLine = strpos($endText, $newLine);
while($posNewLine===0) {
$endText = substr($endText, $posNewLine+2);
$posNewLine = strpos($endText, $newLine);
}
$strRes .= self::cleanNewLine($endText);
}
return $strRes;
}