I'm trying to process result from $data = curl_exec($ch);
instead of printing it on the screen. In order to achieve that I set the option CURLOPT_RETURNTRANSFER
to true
like this:
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
On my local server this works as expected but when I put the same file online on my server it doesn't work.
When I set CURLOPT_RETURNTRANSFER
to false
it works.
What am I doing wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…