curl works at the command line, but how do i put it in a php file?

2

The following curl format works for me from the command line. The line below is just sample data, but the format works.

curl -u email@email.com:1234567 https://api.email.com/status

How do I transfer this into a php file so I can run it within php so I can analyze the result?

OahuRE

Posted 2012-09-10T20:00:38.563

Reputation: 21

Answers

2

Try using PHP's built-in support for libcurl.

For authentication set a CURLOPT_USERPWD value using curl_setopt()

gertvdijk

Posted 2012-09-10T20:00:38.563

Reputation: 3 396