Online Forum To Support Coders With Technical Assistance - Read Write Execute

Post data using curl

Ankit Agrawal
Ankit Agrawal
Published on November 21, 2016 · 1 min read
$aUrl = '####';
$aData= array('key1' => 'val1','key2' => 'val2');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($aData));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
Was this article helpful?
Ankit Agrawal

Ankit Agrawal

Author & Senior Engineer at CodeExecute

Writing practical engineering guides, debugging real-world bottlenecks, and creating free tools for developer productivity.

← Previous Article Preview and Download Html2Canvas Next Article → How to add/remove user role in wordpress