Jump to content

array keys matching function


dadamssg

Recommended Posts

Say i have two arrays with custom keys. What would be the easiest way to write a function that would determine if all the keys in arrayOne are in arrayTwo? The example below would return false because keys 3 and 4 are missing in arrayTwo. Any help would be much appreciate. thanks!

 

<?php

$arrayOne['1'] = "adg";
$arrayOne['2'] = "a4g";
$arrayOne['3'] = "346";
$arrayOne['4'] = "etwe";

$arrayTwo['1'] = "xcb";
$arrayTwo['2'] = "acbr";
$arrayTwo['6'] = "yiy";
$arrayTwo['7'] = "mmm";
?>

Link to comment
https://forums.phpfreaks.com/topic/262483-array-keys-matching-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.