我有一個數組,我需要打印如果電話號碼與字符串匹配,並顯示基於該數字的名字?我必須打印與名稱相應的數字。如何實現這一點如何根據與php中的數組匹配的結果得到結果?
$phone_number = 8056006655;
Array ([0] => Array ([phone] => 8056006655 [country_code] => +91 [status] => [email] => [email protected]ldamanifoundations.com [call_groups] => Array () [role] => [wrap_up_times] => Array () [first_name] => Dominic [id] => 850688 [opt_in] => 1 [last_name] =>)
什麼是PHP版本?使用5.6 – Doug
@Doug IM($ get_agent_array [ '對象']作爲$鍵=> $值){ \t \t \t \t \t \t \t \t \t \t \t \t \t $ agent_phone_number [ 'PHONE_NUMBER'] = $值['電話']; \t \t \t \t $ agent_first_name ['first_name'] = $ value ['first_name']; \t \t \t \t \t \t \t \t //的print_r(array_merge($ agent_phone_number [ 'PHONE_NUMBER'],$ agent_first_name [ '如first_name'])); \t \t \t \t \t \t \t //回波$ get_agent_array [ '對象'] [$鍵] [ '電話']; \t \t \t \t \t // print_r($ agent_phone_number ['phone_number']); \t \t \t \t} –
的foreach –