title: find array key is equal to value in specific array?
body: <p>Hi All already i asked one question regarding array based key equal to value in array.
  Here my previous link please check enter link description <a href="https://stackoverflow.com/questions/53690076/how-to-print-array-object-data-into-array-data-in-php-codeigniter/53690133#53690133"> here</a></p>
  
  <p>If i follow the above link am not getting correct data.
  in_array finding all columns , but i want to find in room_no only one column in a array.
  If i use in_array(1,$singleArray) it will finding all columns in array,i need only key is room_no equal to 1.</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [pass_id] =&gt; 13087
              [AL_RefNo] =&gt; H181200000061
              [passenger_type] =&gt; adult
              [title] =&gt; Mr.
              [first_name] =&gt; R1 F1
              [middle_name] =&gt; 
              [last_name] =&gt; R1 LI
              [gender] =&gt; 
              [child_age] =&gt; 
              [room_no] =&gt; 1
              [zip_code] =&gt; 
              [state] =&gt; 
              [mobile] =&gt; 
              [email] =&gt; 
              [address] =&gt; 
              [country] =&gt; 
              [special_request] =&gt; 
              [HQRequest] =&gt; 
              [lead] =&gt; 1
              [modify_date] =&gt; 
              [srm_pax_id] =&gt; 15037
              [PAX_NAME] =&gt; 
              [CITY] =&gt; 
              [HOTEL_NAME] =&gt; 
              [COUNTRY_NAME] =&gt; 
              [LPO_NUMBER] =&gt; 
              [LPO_DATE] =&gt; 
              [LPO_AMOUNT] =&gt; 
              [LPO_AMOUNT_DIFFERENCE] =&gt; 
              [LINE_SEQUENCE] =&gt; 
              [PROJECT_ID] =&gt; 
              [TRAVEL_TYPE] =&gt; 
              [OTHER_ID] =&gt; 
              [REMARKS] =&gt; 
              [REMARKS1] =&gt; 
              [updated_on] =&gt; 2018-12-19 14:40:33
              [actual_hotel_confirmation_number] =&gt; 
              [is_delete] =&gt; 0
              [modify_refno] =&gt; H181200000061_1
          )
  
      [1] =&gt; Array
          (
              [pass_id] =&gt; 13088
              [AL_RefNo] =&gt; H181200000061
              [passenger_type] =&gt; adult
              [title] =&gt; Mr.
              [first_name] =&gt; R1 F2
              [middle_name] =&gt; 
              [last_name] =&gt; R1 L2
              [gender] =&gt; 
              [child_age] =&gt; 
              [room_no] =&gt; 1
              [zip_code] =&gt; 
              [state] =&gt; 
              [mobile] =&gt; 
              [email] =&gt; 
              [address] =&gt; 
              [country] =&gt; 
              [special_request] =&gt; 
              [HQRequest] =&gt; 
              [lead] =&gt; 0
              [modify_date] =&gt; 
              [srm_pax_id] =&gt; 15038
              [PAX_NAME] =&gt; 
              [CITY] =&gt; 
              [HOTEL_NAME] =&gt; 
              [COUNTRY_NAME] =&gt; 
              [LPO_NUMBER] =&gt; 
              [LPO_DATE] =&gt; 
              [LPO_AMOUNT] =&gt; 
              [LPO_AMOUNT_DIFFERENCE] =&gt; 
              [LINE_SEQUENCE] =&gt; 
              [PROJECT_ID] =&gt; 
              [TRAVEL_TYPE] =&gt; 
              [OTHER_ID] =&gt; 
              [REMARKS] =&gt; 
              [REMARKS1] =&gt; 
              [updated_on] =&gt; 2018-12-11 12:00:35
              [actual_hotel_confirmation_number] =&gt; 
              [is_delete] =&gt; 0
              [modify_refno] =&gt; H181200000061_1
          )
  
      [2] =&gt; Array
          (
              [pass_id] =&gt; 13089
              [AL_RefNo] =&gt; H181200000061
              [passenger_type] =&gt; adult
              [title] =&gt; Mr.
              [first_name] =&gt; R2 F1
              [middle_name] =&gt; 
              [last_name] =&gt; R2 L1
              [gender] =&gt; 
              [child_age] =&gt; 
              [room_no] =&gt; 2
              [zip_code] =&gt; 
              [state] =&gt; 1
              [mobile] =&gt; 
              [email] =&gt; 
              [address] =&gt; 
              [country] =&gt; 
              [special_request] =&gt; 
              [HQRequest] =&gt; 
              [lead] =&gt; 1
              [modify_date] =&gt; 
              [srm_pax_id] =&gt; 15039
              [PAX_NAME] =&gt; 
              [CITY] =&gt; 
              [HOTEL_NAME] =&gt; 
              [COUNTRY_NAME] =&gt; 
              [LPO_NUMBER] =&gt; 
              [LPO_DATE] =&gt; 
              [LPO_AMOUNT] =&gt; 
              [LPO_AMOUNT_DIFFERENCE] =&gt; 
              [LINE_SEQUENCE] =&gt; 
              [PROJECT_ID] =&gt; 
              [TRAVEL_TYPE] =&gt; 
              [OTHER_ID] =&gt; 
              [REMARKS] =&gt; 
              [REMARKS1] =&gt; 
              [updated_on] =&gt; 2018-12-11 12:00:35
              [actual_hotel_confirmation_number] =&gt; 
              [is_delete] =&gt; 0
              [modify_refno] =&gt; H181200000061_1
          )
  
      [3] =&gt; Array
          (
              [pass_id] =&gt; 13090
              [AL_RefNo] =&gt; H181200000061
              [passenger_type] =&gt; adult
              [title] =&gt; Ms.
              [first_name] =&gt; R2 F2
              [middle_name] =&gt; 
              [last_name] =&gt; R2 L2
              [gender] =&gt; 
              [child_age] =&gt; 
              [room_no] =&gt; 2
              [zip_code] =&gt; 
              [state] =&gt; 1
              [mobile] =&gt; 
              [email] =&gt; 
              [address] =&gt; 
              [country] =&gt; 
              [special_request] =&gt; 
              [HQRequest] =&gt; 
              [lead] =&gt; 1
              [modify_date] =&gt; 
              [srm_pax_id] =&gt; 15040
              [PAX_NAME] =&gt; 
              [CITY] =&gt; 
              [HOTEL_NAME] =&gt; 
              [COUNTRY_NAME] =&gt; 
              [LPO_NUMBER] =&gt; 
              [LPO_DATE] =&gt; 
              [LPO_AMOUNT] =&gt; 
              [LPO_AMOUNT_DIFFERENCE] =&gt; 
              [LINE_SEQUENCE] =&gt; 
              [PROJECT_ID] =&gt; 
              [TRAVEL_TYPE] =&gt; 
              [OTHER_ID] =&gt; 
              [REMARKS] =&gt; 
              [REMARKS1] =&gt; 
              [updated_on] =&gt; 2018-12-19 14:40:38
              [actual_hotel_confirmation_number] =&gt; 
              [is_delete] =&gt; 0
              [modify_refno] =&gt; H181200000061_1
          )
  
      [4] =&gt; Array
          (
              [pass_id] =&gt; 13091
              [AL_RefNo] =&gt; H181200000061
              [passenger_type] =&gt; child
              [title] =&gt; Miss.
              [first_name] =&gt; R2 C1
              [middle_name] =&gt; 
              [last_name] =&gt; R2 CL1
              [gender] =&gt; 
              [child_age] =&gt; 10
              [room_no] =&gt; 2
              [zip_code] =&gt; 
              [state] =&gt; 
              [mobile] =&gt; 
              [email] =&gt; 
              [address] =&gt; 
              [country] =&gt; 
              [special_request] =&gt; 
              [HQRequest] =&gt; 
              [lead] =&gt; 
              [modify_date] =&gt; 
              [srm_pax_id] =&gt; 15041
              [PAX_NAME] =&gt; 
              [CITY] =&gt; 
              [HOTEL_NAME] =&gt; 
              [COUNTRY_NAME] =&gt; 
              [LPO_NUMBER] =&gt; 
              [LPO_DATE] =&gt; 
              [LPO_AMOUNT] =&gt; 
              [LPO_AMOUNT_DIFFERENCE] =&gt; 
              [LINE_SEQUENCE] =&gt; 
              [PROJECT_ID] =&gt; 
              [TRAVEL_TYPE] =&gt; 
              [OTHER_ID] =&gt; 
              [REMARKS] =&gt; 
              [REMARKS1] =&gt; 
              [updated_on] =&gt; 2018-12-11 12:00:35
              [actual_hotel_confirmation_number] =&gt; 
              [is_delete] =&gt; 0
              [modify_refno] =&gt; H181200000061_1
          )
  
      [5] =&gt; Array
          (
              [pass_id] =&gt; 13092
              [AL_RefNo] =&gt; H181200000061
              [passenger_type] =&gt; adult
              [title] =&gt; Mr.
              [first_name] =&gt; R3 F1
              [middle_name] =&gt; 
              [last_name] =&gt; R3 L1
              [gender] =&gt; 
              [child_age] =&gt; 
              [room_no] =&gt; 3
              [zip_code] =&gt; 
              [state] =&gt; 
              [mobile] =&gt; 
              [email] =&gt; 
              [address] =&gt; 
              [country] =&gt; 
              [special_request] =&gt; 
              [HQRequest] =&gt; 
              [lead] =&gt; 1
              [modify_date] =&gt; 
              [srm_pax_id] =&gt; 15042
              [PAX_NAME] =&gt; 
              [CITY] =&gt; 
              [HOTEL_NAME] =&gt; 
              [COUNTRY_NAME] =&gt; 
              [LPO_NUMBER] =&gt; 
              [LPO_DATE] =&gt; 
              [LPO_AMOUNT] =&gt; 
              [LPO_AMOUNT_DIFFERENCE] =&gt; 
              [LINE_SEQUENCE] =&gt; 
              [PROJECT_ID] =&gt; 
              [TRAVEL_TYPE] =&gt; 
              [OTHER_ID] =&gt; 
              [REMARKS] =&gt; 
              [REMARKS1] =&gt; 
              [updated_on] =&gt; 2018-12-11 12:00:35
              [actual_hotel_confirmation_number] =&gt; 
              [is_delete] =&gt; 0
              [modify_refno] =&gt; H181200000061_1
          )
  
      [6] =&gt; Array
          (
              [pass_id] =&gt; 13093
              [AL_RefNo] =&gt; H181200000061
              [passenger_type] =&gt; adult
              [title] =&gt; Ms.
              [first_name] =&gt; R3 F2
              [middle_name] =&gt; 
              [last_name] =&gt; R3 L2
              [gender] =&gt; 
              [child_age] =&gt; 
              [room_no] =&gt; 3
              [zip_code] =&gt; 
              [state] =&gt; 
              [mobile] =&gt; 
              [email] =&gt; 
              [address] =&gt; 
              [country] =&gt; 
              [special_request] =&gt; 
              [HQRequest] =&gt; 
              [lead] =&gt; 1
              [modify_date] =&gt; 
              [srm_pax_id] =&gt; 15043
              [PAX_NAME] =&gt; 
              [CITY] =&gt; 
              [HOTEL_NAME] =&gt; 
              [COUNTRY_NAME] =&gt; 
              [LPO_NUMBER] =&gt; 
              [LPO_DATE] =&gt; 
              [LPO_AMOUNT] =&gt; 
              [LPO_AMOUNT_DIFFERENCE] =&gt; 
              [LINE_SEQUENCE] =&gt; 
              [PROJECT_ID] =&gt; 
              [TRAVEL_TYPE] =&gt; 
              [OTHER_ID] =&gt; 
              [REMARKS] =&gt; 
              [REMARKS1] =&gt; 
              [updated_on] =&gt; 2018-12-19 14:46:17
              [actual_hotel_confirmation_number] =&gt; 
              [is_delete] =&gt; 0
              [modify_refno] =&gt; H181200000061_1
          )
  
      [7] =&gt; Array
          (
              [pass_id] =&gt; 13094
              [AL_RefNo] =&gt; H181200000061
              [passenger_type] =&gt; adult
              [title] =&gt; Mr.
              [first_name] =&gt; R4 F1
              [middle_name] =&gt; 
              [last_name] =&gt; R4 L1
              [gender] =&gt; 
              [child_age] =&gt; 
              [room_no] =&gt; 4
              [zip_code] =&gt; 
              [state] =&gt; 
              [mobile] =&gt; 
              [email] =&gt; 
              [address] =&gt; 
              [country] =&gt; 
              [special_request] =&gt; 
              [HQRequest] =&gt; 
              [lead] =&gt; 1
              [modify_date] =&gt; 
              [srm_pax_id] =&gt; 15044
              [PAX_NAME] =&gt; 
              [CITY] =&gt; 
              [HOTEL_NAME] =&gt; 
              [COUNTRY_NAME] =&gt; 
              [LPO_NUMBER] =&gt; 
              [LPO_DATE] =&gt; 
              [LPO_AMOUNT] =&gt; 
              [LPO_AMOUNT_DIFFERENCE] =&gt; 
              [LINE_SEQUENCE] =&gt; 
              [PROJECT_ID] =&gt; 
              [TRAVEL_TYPE] =&gt; 
              [OTHER_ID] =&gt; 
              [REMARKS] =&gt; 
              [REMARKS1] =&gt; 
              [updated_on] =&gt; 2018-12-19 14:46:25
              [actual_hotel_confirmation_number] =&gt; 
              [is_delete] =&gt; 0
              [modify_refno] =&gt; H181200000061_1
          )
  
      [8] =&gt; Array
          (
              [pass_id] =&gt; 13095
              [AL_RefNo] =&gt; H181200000061
              [passenger_type] =&gt; adult
              [title] =&gt; Ms.
              [first_name] =&gt; R4 F2
              [middle_name] =&gt; 
              [last_name] =&gt; R4 L2
              [gender] =&gt; 
              [child_age] =&gt; 
              [room_no] =&gt; 4
              [zip_code] =&gt; 
              [state] =&gt; 
              [mobile] =&gt; 
              [email] =&gt; 
              [address] =&gt; 
              [country] =&gt; 
              [special_request] =&gt; 
              [HQRequest] =&gt; 
              [lead] =&gt; 0
              [modify_date] =&gt; 
              [srm_pax_id] =&gt; 15045
              [PAX_NAME] =&gt; 
              [CITY] =&gt; 
              [HOTEL_NAME] =&gt; 
              [COUNTRY_NAME] =&gt; 
              [LPO_NUMBER] =&gt; 
              [LPO_DATE] =&gt; 
              [LPO_AMOUNT] =&gt; 
              [LPO_AMOUNT_DIFFERENCE] =&gt; 
              [LINE_SEQUENCE] =&gt; 
              [PROJECT_ID] =&gt; 
              [TRAVEL_TYPE] =&gt; 
              [OTHER_ID] =&gt; 
              [REMARKS] =&gt; 
              [REMARKS1] =&gt; 
              [updated_on] =&gt; 2018-12-11 12:00:35
              [actual_hotel_confirmation_number] =&gt; 
              [is_delete] =&gt; 0
              [modify_refno] =&gt; H181200000061_1
          )
  
      [9] =&gt; Array
          (
              [pass_id] =&gt; 13096
              [AL_RefNo] =&gt; H181200000061
              [passenger_type] =&gt; adult
              [title] =&gt; Mr.
              [first_name] =&gt; R5 F1
              [middle_name] =&gt; 
              [last_name] =&gt; R5 L1
              [gender] =&gt; 
              [child_age] =&gt; 
              [room_no] =&gt; 5
              [zip_code] =&gt; 
              [state] =&gt; 
              [mobile] =&gt; 
              [email] =&gt; 
              [address] =&gt; 
              [country] =&gt; 
              [special_request] =&gt; 
              [HQRequest] =&gt; 
              [lead] =&gt; 1
              [modify_date] =&gt; 
              [srm_pax_id] =&gt; 15046
              [PAX_NAME] =&gt; 
              [CITY] =&gt; 
              [HOTEL_NAME] =&gt; 
              [COUNTRY_NAME] =&gt; 
              [LPO_NUMBER] =&gt; 
              [LPO_DATE] =&gt; 
              [LPO_AMOUNT] =&gt; 
              [LPO_AMOUNT_DIFFERENCE] =&gt; 
              [LINE_SEQUENCE] =&gt; 
              [PROJECT_ID] =&gt; 
              [TRAVEL_TYPE] =&gt; 
              [OTHER_ID] =&gt; 
              [REMARKS] =&gt; 
              [REMARKS1] =&gt; 
              [updated_on] =&gt; 2018-12-18 17:54:33
              [actual_hotel_confirmation_number] =&gt; 
              [is_delete] =&gt; 0
              [modify_refno] =&gt; H181200000061_1
          )
  
      [10] =&gt; Array
          (
              [pass_id] =&gt; 13097
              [AL_RefNo] =&gt; H181200000061
              [passenger_type] =&gt; adult
              [title] =&gt; Ms.
              [first_name] =&gt; R5 F2
              [middle_name] =&gt; 
              [last_name] =&gt; R5 L2
              [gender] =&gt; 
              [child_age] =&gt; 
              [room_no] =&gt; 5
              [zip_code] =&gt; 
              [state] =&gt; 
              [mobile] =&gt; 
              [email] =&gt; 
              [address] =&gt; 
              [country] =&gt; 
              [special_request] =&gt; 
              [HQRequest] =&gt; 
              [lead] =&gt; 0
              [modify_date] =&gt; 
              [srm_pax_id] =&gt; 15047
              [PAX_NAME] =&gt; 
              [CITY] =&gt; 
              [HOTEL_NAME] =&gt; 
              [COUNTRY_NAME] =&gt; 
              [LPO_NUMBER] =&gt; 
              [LPO_DATE] =&gt; 
              [LPO_AMOUNT] =&gt; 
              [LPO_AMOUNT_DIFFERENCE] =&gt; 
              [LINE_SEQUENCE] =&gt; 
              [PROJECT_ID] =&gt; 
              [TRAVEL_TYPE] =&gt; 
              [OTHER_ID] =&gt; 
              [REMARKS] =&gt; 
              [REMARKS1] =&gt; 
              [updated_on] =&gt; 2018-12-11 12:00:35
              [actual_hotel_confirmation_number] =&gt; 
              [is_delete] =&gt; 0
              [modify_refno] =&gt; H181200000061_1
          )
  
      [11] =&gt; Array
          (
              [pass_id] =&gt; 13098
              [AL_RefNo] =&gt; H181200000061
              [passenger_type] =&gt; child
              [title] =&gt; Master.
              [first_name] =&gt; R5 CF1
              [middle_name] =&gt; 
              [last_name] =&gt; R5 CL1
              [gender] =&gt; 
              [child_age] =&gt; 9
              [room_no] =&gt; 5
              [zip_code] =&gt; 
              [state] =&gt; 
              [mobile] =&gt; 
              [email] =&gt; 
              [address] =&gt; 
              [country] =&gt; 
              [special_request] =&gt; 
              [HQRequest] =&gt; 
              [lead] =&gt; 
              [modify_date] =&gt; 
              [srm_pax_id] =&gt; 15048
              [PAX_NAME] =&gt; 
              [CITY] =&gt; 
              [HOTEL_NAME] =&gt; 
              [COUNTRY_NAME] =&gt; 
              [LPO_NUMBER] =&gt; 
              [LPO_DATE] =&gt; 
              [LPO_AMOUNT] =&gt; 
              [LPO_AMOUNT_DIFFERENCE] =&gt; 
              [LINE_SEQUENCE] =&gt; 
              [PROJECT_ID] =&gt; 
              [TRAVEL_TYPE] =&gt; 
              [OTHER_ID] =&gt; 
              [REMARKS] =&gt; 
              [REMARKS1] =&gt; 
              [updated_on] =&gt; 2018-12-11 12:00:35
              [actual_hotel_confirmation_number] =&gt; 
              [is_delete] =&gt; 0
              [modify_refno] =&gt; H181200000061_1
          )
  
  )
  </code></pre>
  
  <p>If you see above output in array [room_no] found 2 times in that array[0], array<a href="https://stackoverflow.com/questions/53690076/how-to-print-array-object-data-into-array-data-in-php-codeigniter/53690133#53690133">1</a>. if i use <code>in_array(1,$myArrayOutPut){ }</code> it will taking array[3],array[4] state key also 1 .so taking this all arrays where key is 1. But i need room_no is 1</p>