-2
Array
(
    [result] => 0
    [room] => Array
        (
            [name] => room for one to one video meeting: 306100
            [service_id] => 5f6c5b420dd7940701cc36b1
            [owner_ref] => 306100
            [settings] => Array
                (
                    [mode] => group
                    [scheduled] => 
                    [adhoc] => 1
                    [duration] => 30
                    [participants] => 1
                    [auto_recording] => 
                    [screen_share] => 1
                    [canvas] => 
                    [media_configuration] => default
                    [quality] => SD
                    [moderators] => 1
                    [active_talker] => 1
                    [max_active_talkers] => 1
                    [single_file_recording] => 
                    [media_zone] => XX
                )

            [sip] => Array
                (
                    [enabled] => 
                )

            [created] => 2021-04-19T05:52:26.779Z
            [room_id] => 607d1a9a4e11874ceda79a96
        )

)

how to find room_id this array

Nigel Ren
  • 56,122
  • 11
  • 43
  • 55

1 Answers1

-1

The array_search() function searches an array for a given value and returns the key. The function returns the key for val if it is found in the array. It returns FALSE if it is not found. If val is found in the array arr more than once, then the first matching key is returned.

Syntax array_search(val, arr, strict) Parameters val − The value to be searched

arr − The array to be searched

strict − Possible values are TRUE or FALSE. Search for identical elements in the array, set to TRUE.

example :-

<?php
$arr = array("p"=>20,"q"=>20,"r"=>30,"s"=>40);
echo array_search(20,$arr,true);
?>
  • Please do not ignore the OP's sample data in your answer. Your answer deviates too far and gives an unnecessary suggestion. – mickmackusa Apr 19 '21 at 06:40