curl: php function to post curl request to url with post data