Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
Created August 22, 2013 22:28
Show Gist options
  • Save phpfiddle/6313597 to your computer and use it in GitHub Desktop.
Save phpfiddle/6313597 to your computer and use it in GitHub Desktop.
testing array_diff_key
<?php
$original = array('esfid'=> 'kldjfsdkfjd');
$new = array(
'esfid' => '001GOdemoESFID0',
'opst' => 'won',
'opsfid' => '006c0000002fZvb',
'product' => 'ePm-d30a1',
'quantity' => '4',
'ename' => 'test',
'itemid' => '00kc0000007SdmU',
);
if ( $new && array_diff_key( $original, $new ) ) //@TODO: verify this - aren't keys flexible??
{
echo 'they are diff!';
}
else
{
echo 'they are not diff!!';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment