I need a bit of help porting a function over from the drupal code.
I have found out that drupal_http_request is basically file_get_contents, but when i change it, i seem to be getting errors,
The original drupal code is as follows:
$response = drupal_http_request($url, array('Content-Type' => 'text/xml'), 'POST', $post_data);
Basically all im doing is replacing it so it looks like so
$response = file_get_contents($url, array('Content-Type' => 'text/xml'), 'POST', $post_data);
When i run this though … i get the following error message
file_get_contents() expects parameter 2 to be boolean
Im wondering if anyone can help me port it over.
Thanks
file_get_contentsdoes not take array as second argument see http://php.net/manual/en/function.file-get-contents.php for detail examples