fork download
  1. <?php
  2.  
  3. $data = (object) [
  4. "Chats" => [
  5. (object) ["Chat" => (object) ["ChatId" => 1000]],
  6. (object) ["Chat" => (object) ["ChatId" => 2000]],
  7. (object) ["Chat" => (object) ["ChatId" => 3000]],
  8. (object) ["Chat" => (object) ["ChatId" => 4000]],
  9. (object) ["Chat" => (object) ["ChatId" => 5000]],
  10. ]
  11. ];
  12.  
  13. $Chats = array_column($data->Chats, "Chat");
  14. $ChatIds = array_column($Chats, "ChatId");
  15.  
  16. var_export($ChatIds);
Success #stdin #stdout 0s 82560KB
stdin
Standard input is empty
stdout
array (
  0 => 1000,
  1 => 2000,
  2 => 3000,
  3 => 4000,
  4 => 5000,
)