Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php + http_post_data

Tags:

php

Is there a way to check if this is installed? Maybe something in phpinfo()?

I'm doing the call below and I don't get any reply at all. The page just ends when it gets to it.

        $postdata = array(
            'validation' => '1'
        );


        $response = http_post_data('../ajax/index_ajax_general.php', $postdata);
        print $response;
like image 402
Adam Avatar asked Jan 22 '26 23:01

Adam


1 Answers

You could use

if (extension_loaded('pecl_http') == false) {
    // do not have extension
}

// or

if (function_exists('http_post_data') == false) {
    // function not available
}

Given that function is a PECL extension, you will probably find most PHP installations do not have these functions available.

like image 181
drew010 Avatar answered Jan 25 '26 14:01

drew010



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!