- <?php
- function test($options=array()) {
- $defaults = array(
- 'name' => 'xxoo',
- 'sex' => 'xoxo'
- );
- $options = array_merge($defaults, $options);
- print_r($options);
- }
- test(array('name'=>'nidaye'));
- ?>
- //该片段来自于http://www.codesnippet.cn/detail/0203201511813.html
来源: http://www.codesnippet.cn/detail/0203201511813.html