Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php function post_sl($data){ $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_POST => 1, CURLOPT_HEADER => 0, CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => "https://suggestions.dadata.ru/suggestions/api/4_1/rs/findById/party", CURLOPT_POSTFIELDS => json_encode($data), CURLOPT_HTTPHEADER => array_merge(array("Content-Type: application/json", "Authorization: Token e9dcea72f7007707ae2f073cf73e1555445c2a4c", "X-Secret: be9175893a4d061da8bc13bfca63ce682be52dc0")), ]); $result = curl_exec($curl); curl_close($curl); return (json_decode($result, 1) ? json_decode($result, 1) : $result); }; $data = array("query"=> "6732081898"); $d = post_sl($data); print_r($d[suggestions][0][data]);
Copy Clear