Skip to content

Instantly share code, notes, and snippets.

@bayleedev
Last active August 29, 2015 14:02
Show Gist options
  • Save bayleedev/810f6595617f429be0a7 to your computer and use it in GitHub Desktop.
Save bayleedev/810f6595617f429be0a7 to your computer and use it in GitHub Desktop.
<?php
$options = array(
'conditions' => array(
'type' => 'json',
'accept' => array('application/json'),
),
);
$options = array_replace_recursive(array(
'conditions' => array(
'type' => null,
'accept' => array(),
),
'encode' => null,
), $options);
print_r(compact('options'));
/**
Array
(
[options] => Array
(
[conditions] => Array
(
[type] => json
[accept] => Array
(
[0] => application/json
)
)
[encode] =>
)
)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment