Sindbad~EG File Manager

Current Path : /proc/thread-self/cwd/06052021/
Upload File :
Current File : //proc/thread-self/cwd/06052021/teste.php

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

// Primeiro REQUEST
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://viacep.com.br/ws/01001000/json/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$ret = curl_exec($ch);
$result = json_decode($ret,true);

// Pegar o retorno do cep para passar no SEGUNDO REQUEST
$parametro = str_replace('-', '', $result['cep']);

curl_close($ch);

// Segundo REQUEST
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://viacep.com.br/ws/'.$parametro.'/json/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$ret2 = curl_exec($ch);
$result2 = json_decode($ret2,true);
$error = curl_error($ch);
if (!empty($error)) {
    echo "The request return a error: $error" . "\n";
}
else {
    echo '<pre>';
    var_dump($result2);
    echo '</pre>';
}

curl_close($ch);

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists