Php curl is written in the same function, but it is requested at the same time.

I write curl on a function like this:

function httpRequest ($api, $data_string)
{
  $ch = curl_init($api);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
  $result = curl_exec($ch);
  curl_close($ch);

  return json_decode($result);
}

and then I ask for it with someone else

.
$api_a = "a";
$api_b = "b";

$get_a = array(
      "session" => $_SESSION["session"]
    );
    $get_a_str = json_encode($get_a);
    $get_a = httpRequest($api_a, $get_a_str);
    
$get_b = array(
      "session" => $_SESSION["session"]
    );
    $get_b_str = json_encode($get_b);
    $get_b = httpRequest($api_b, $get_b_str);

write on the same website:

  <?foreach ($get_a->dataA as $key) {?>
          <?=@$key->{"name"};?>
        <?}?>
  <?foreach ($get_b->dataB as $key) {?>
          <?=@$key->{"name"};?>
        <?}?>

Why not at the same time?
he can only ask for one of them, and the other will be invalid? (only when you are at the top)

he will hug:

Undefined variable: get_b
Trying to get property "dataB" of non-object
Invalid argument supplied for foreach()

I just need to drop An and I can do it. B
I can change A by dropping B

.
Mar.01,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31ab3-2aaf8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31ab3-2aaf8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?