Guzzle api call execution time is too long with foreach loop in php
Get the solution ↓↓↓I'm trying to call the api inside another api in the foreach loop but the execution time is too long I've tried many ways but the same problem This is my code
<?php
require_once 'vendor/autoload.php';
$client = new GuzzleHttp\Client( ['headers' => ['X-EXEMPLE' => '00-00-10']] );
$res = $client->get('https://api.example.com/index.php/records/orders');
$OrdersData = json_decode( $res->getBody(), true );
foreach ($OrdersData['records'] as $key) {
$res = $client->get('https://api.example.com/index.php/records/users/'.$key['user_id']);
$UserData = json_decode( $res->getBody() );
$User_Name = $UserData->name;
$User_Phone = $UserData->phone;
echo $key['unique_order_id'] . ' ' . $User_Name . ' ' . $User_Phone . '<br />' ;
}
?>
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: call to undefined function illuminate\encryption\openssl_cipher_iv_length()
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.