I’m having trouble with
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1). My code is working perfectly in localhost, but not on the server.
Basically, I don’t want to display any result on the screen when I use
My code consists of a loop that downloads files from a site (the download urls are contained in an array) and renames it. When I run the codes on the server,
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1) works for the first few times, but it’s always printing at least 1 result to the screen when using
curl_exec($ch). I’ve tried pasting
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1) everywhere but still the same result.
Also, when there’s only 1 url in the loop, nothing is printed on the screen.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!