I am interested to know what exactly passthru() is doing?
I have to create my own function with similar functionality, but I cannot understand how the function works.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The internals of
passthruwon’t help you much, since they’re too low-level to be reproducible by PHP.If you want to do this on PHP level without first reading the whole output into a variable, I’d suggest something like
popen. This lets you open a pointer to a process, from which you can read little by little and write the data to a file little by little (which is actually probably pretty close to whatpassthrudoes). E.g.:If you’re working on the command line anyway though, why not just write to a file there?