Post data using curl

Accepts data as associative array and posts it to specified URL.

php
fork add to bundle source
function curl_post($url, $data) { $ch = curl_init($url); curl_setopt_array($ch, [ CURLOPT_POST => 1, CURLOPT_POSTFIELDS => http_build_query($data), CURLOPT_RETURNTRANSFER => true ]); return curl_exec($ch); }

usage

load_function('curl_post'); curl_post('https://example.com', ['variable' => 'value']); // Will send POST request and return result
← how to use this in app?
create log ...inout