public static function sendPost($url, array $data, $client_ip = '')
    {
        $ch = curl_init();

        $params = http_build_query($data);

        $opt = [ 
            CURLOPT_URL => $url,
            CURLOPT_POST => 1,
            CURLOPT_POSTFIELDS => $params,
            CURLOPT_RETURNTRANSFER => 1,
        ];

        if ($client_ip) {
            $opt[CURLOPT_HTTPHEADER] = [ 
                "CLIENT-IP: {$client_ip}", "X-FORWARDED-FOR: {$client_ip}"
            ];
        }

        curl_setopt_array($ch, $opt);

        $json = curl_exec($ch);

        return $json; 
    }
public static function sendPost($url, array $data, $client_ip = '')
    {
        $ch = curl_init();

        $params = http_build_query($data);

        $opt = [ 
            CURLOPT_URL => $url,
            CURLOPT_POST => 1,
            CURLOPT_POSTFIELDS => $params,
            CURLOPT_RETURNTRANSFER => 1,
        ];

        if ($client_ip) {
            $opt[CURLOPT_HTTPHEADER] = [ 
                "CLIENT-IP: {$client_ip}", "X-FORWARDED-FOR: {$client_ip}"
            ];
        }

        curl_setopt_array($ch, $opt);

        $json = curl_exec($ch);

        return $json; 
    }
public static function sendPost ( $ url , array $ data , $ client_ip = '' ) { $ ch = curl_init ( ) ; $ params = http_build_query ( $ data ) ; $ opt = [ CURLOPT_URL => $ url , CURLOPT_POST => 1 , CURLOPT_POSTFIELDS => $ params , CURLOPT_RETURNTRANSFER => 1 , ] ; if ( $ client_ip ) { $ opt [ CURLOPT_HTTPHEADER ] = [ "CLIENT-IP: {$client_ip}" , "X-FORWARDED-FOR: {$client_ip}" ] ; } curl_setopt_array ( $ ch , $ opt ) ; $ json = curl_exec ( $ ch ) ; return $ json ; }
Curl post.

@param
@param
@param
@param

@return string json

@farwish
Curl post .