Quantcast
Viewing all articles
Browse latest Browse all 22

Answer by j4r3k for How to check if multiple array keys exists

// sample data$requiredKeys = ['key1', 'key2', 'key3'];$arrayToValidate = ['key1' => 1, 'key2' => 2, 'key3' => 3];function keysExist(array $requiredKeys, array $arrayToValidate) {    if ($requiredKeys === array_keys($arrayToValidate)) {        return true;    }    return false;}

Viewing all articles
Browse latest Browse all 22

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>