Counting the first 1000 digits of Pi and Beyond

This code uses pi.delivery to extract Pi digits.

Change the bolded number to change the position of where you wish to grab Pi digits to 1000.

Max digits is 1000.

$url = 'https://api.pi.delivery/v1/pi?start=0&numberOfDigits=1000';
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); }
curl_close($ch);
$pijson = json_decode($result, true);
$digits = $pijson["content"];