Skip to content

Instantly share code, notes, and snippets.

@sandeepshetty
Created May 24, 2012 05:53
Show Gist options
  • Save sandeepshetty/2779709 to your computer and use it in GitHub Desktop.
Save sandeepshetty/2779709 to your computer and use it in GitHub Desktop.
PHP array union operator example
<?php
$default_settings = array('page'=>3, 'per_page'=>100);
$user_override = array('per_page'=>50, 'format'=>'json');
$overriden_setting = $user_override + $default_settings;
print_r($overriden_setting);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment