Home > Article > Backend Development > How to get the return value in php curl
Contents of this section: How to implement php curl to get the return value There is a parameter curlopt_returntransfer in curl:
The default is 0 to directly return the text stream of the obtained output. Sometimes the return value is used for judgment or other purposes. Fortunately curlopt_returntransfer can be set, if set to curlopt_returntransfer 1:
can be used without curl_close before closing a curl session: curl_multi_getcontent($ch) You can get the server return value. It is a string type! The php manual is as follows:
If curlopt_returntransfer as an option is set to a specific handle, then this function will return the content obtained by that curl handle in the form of a string . |