public static function post($url, $params)
    {
        if (!is_array($params)) {
            $params = self::ar($params);
        }

        $query = http_build_query($params);

        /*
         * open connection.
         */
        $ch = curl_init();

        /*
         * set the url, number of POST vars, POST data.
         */
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, count($params));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $query);

        /*
         * execute post.
         */
        $r = curl_exec( $ch );

        /*
         * close connection.
         */
        curl_close($ch);

        return $r;
    }
public static function post($url, $params)
    {
        if (!is_array($params)) {
            $params = self::ar($params);
        }

        $query = http_build_query($params);

        /*
         * open connection.
         */
        $ch = curl_init();

        /*
         * set the url, number of POST vars, POST data.
         */
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, count($params));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $query);

        /*
         * execute post.
         */
        $r = curl_exec( $ch );

        /*
         * close connection.
         */
        curl_close($ch);

        return $r;
    }
public static function post ( $ url , $ params ) { if ( ! is_array ( $ params ) ) { $ params = self :: ar ( $ params ) ; } $ query = http_build_query ( $ params ) ; /*
         * open connection.
         */ $ ch = curl_init ( ) ; /*
         * set the url, number of POST vars, POST data.
         */ curl_setopt ( $ ch , CURLOPT_URL , $ url ) ; curl_setopt ( $ ch , CURLOPT_POST , count ( $ params ) ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , true ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , $ query ) ; /*
         * execute post.
         */ $ r = curl_exec ( $ ch ) ; /*
         * close connection.
         */ curl_close ( $ ch ) ; return $ r ; }
Performs a post request to given url passing given parameters.


@param  string $url    the url
@param  mixed  $params array, class or string parameter. See THETOOLS::ar()
@return string         the output of the requested url.
Performs a post request to given url passing given parameters .