The substr function in my PHP file has an empty string as a result.
Here is my PHP code:
<?php
$requestArray = array(
'http'=>array(
'method'=>"GET",
'header'=>"User-agent: MKUxA&8PtUYP(d3So)pfPSIvD5cf75"
)
);
$stream = stream_context_create($requestArray);
$streamResult = file_get_contents('https://beoordelingen.feedbackcompany.nl/samenvoordeel/scripts/flexreview/getreviewxml.cfm?ws=9673&publishIDs=0&nor=0&publishDetails=0&publishDetailScores=0&publishOnHold=0&sort=desc&foreign=1&v=3&publishDetailScores=1&Basescore=10', false, $stream);
$str = substr($streamResult, 0, 3);
var_dump($str);
echo "<br>";
var_dump($streamResult);
echo "<br>";
var_dump($http_response_header);
?>
This is the result:
string(3) "string(251) " 8.7109https://beoordelingen.feedbackcompany.nl/NL-NL/De%2DMariannehoeve.html "
array(6) { [0]=> string(15) "HTTP/1.1 200 OK" [1]=> string(37) "Content-Type: text/xml; charset=UTF-8" [2]=> string(25) "Server: Microsoft-IIS/7.5" [3]=> string(21) "X-Powered-By: ASP.NET" [4]=> string(35) "Date: Mon, 22 Feb 2016 13:39:34 GMT" [5]=> string(17) "Connection: close" }
Could anyone tell me what I'm doing wrong and help me out?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…