PHP

cURL in PHP

Në shqip: cURL në PHP

ShpjegimiSQ

Me zgjerimin cURL, PHP-ja dërgon kërkesa HTTP te API të tjera. Funksionon, por API-ja është e vjetër dhe e gjatë — në projekte moderne përdoret Guzzle ose Http client i Laravel-it.

EnglishEN

With the cURL extension, PHP sends HTTP requests to other APIs. It works, but the API is old and verbose — modern projects use Guzzle or Laravel's Http client.

Si ta mendosh

Si të telefonosh një shërbim tjetër nga brenda kodit.

Lexoje në anglisht

Like phoning another service from inside your code.

Shembull kodiphp

$ch = curl_init('https://api.example.com/notat');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$pergjigja = json_decode(curl_exec($ch), true);

Terma të lidhur