Skip to content

Instantly share code, notes, and snippets.

@fernandez14
Created November 12, 2014 16:25
Show Gist options
  • Save fernandez14/0e49b1941e1d2e5a3b85 to your computer and use it in GitHub Desktop.
Save fernandez14/0e49b1941e1d2e5a3b85 to your computer and use it in GitHub Desktop.
Forking curl process
<?php
private function request($url, $payload) {
$cmd = "curl -X POST -H 'Content-Type: application/json'";
$cmd.= " -d '" . $payload . "' " . "'" . $url . "'";
if (!$this->debug()) {
$cmd .= " > /dev/null 2>&1 &";
}
exec($cmd, $output, $exit);
return $exit == 0;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment