0

I have a variable called $filter. If I run echo $filter; I get the contents of it. However, If I run

file_put_contents("/nrj/vvr/tmp/lol", $filter);

I do get the file, but the contents is just 1. It should contain alot of different things. I use the exact same syntax usually, and it works. I get no error messages.

DisplayName
  • 215
  • 1
  • 12

1 Answers1

0

This line was the problem

$filter = curl_exec($ch);

For some reason, it ignores the first things and just executes it without setting any variable. Under this I had

echo $filter;

Giving me the impression that it was that line that output it, but it was the one above.

DisplayName
  • 215
  • 1
  • 12
  • So this is resolved or you need to get the CURL response to the variable? http://stackoverflow.com/questions/18203411/save-curl-display-output-string-in-variable-php – chris85 Dec 11 '15 at 18:32
  • @chris85 I have solved the issue in another way, but I had this already set in my code `curl_setopt($url, CURLOPT_RETURNTRANSFER, true);`. – DisplayName Dec 11 '15 at 18:33