true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => 'search_data=' . urlencode($search), CURLOPT_HTTPHEADER => ['Content-Type: application/x-www-form-urlencoded'], ]); $response = curl_exec($ch); curl_close($ch); $result = json_decode($response, true); if (!empty($result['success']) && !empty($result['data'][0])) { $responseData = $result['data'][0]; } } ?>