Files
namaste/stubs/arrayDiff.php
gramps 373ebc8c93 Archive: Namaste PHP AMQP framework v1.0 (2017-2020)
952 days continuous production uptime, 40k+ tp/s single node.
Original corpo Bitbucket history not included — clean archive commit.
2026-04-05 09:49:30 -07:00

22 lines
482 B
PHP

<?php
$array1 = [ 'color' => 'red', 'size' => 'XL', 'style' => 'gothic', 'brand' => 'levi', 'token' => 1 ];
$array2 = [ 'color' => 1, 'brand' => 1 ];
$array3 = array_diff_key($array1, $array2);
$array4 = ['token' => mt_rand(0, 10), 'color' => 'red', 'size' => 'xl'];
$array5 = [ 'token' => 1 ];
echo PHP_EOL;
if (empty($array3))
echo "no results returned";
else
var_export($array3);
echo PHP_EOL;
$array4 = array_intersect_key($array1, $array5);
var_export($array4);