在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
int array_unshift ( array array_unshift() prepends passed elements to the front of the <?php $queue = array('a', 'b', 'c'); array_unshift($queue, 'unshift'); w($queue); $queue = array('a', 'b', 'c'); array_unshift($queue, array('unshift','unshift_1')); w($queue); $queue = array('a', 'b', 'c','D'=>'dd'); array_unshift($queue, 'unshift'); w($queue); $queue = array('a', 'b', 'c','D'=>'dd',array('unshift','unshift_1')); array_unshift($queue, array('unshift','unshift_1')); w($queue); die(); D:\wamp64\www\w0827pm\study.php:109: array (size=4) 0 => string 'unshift' (length=7) 1 => string 'a' (length=1) 2 => string 'b' (length=1) 3 => string 'c' (length=1) D:\wamp64\www\w0827pm\study.php:109: array (size=4) 0 => array (size=2) 0 => string 'unshift' (length=7) 1 => string 'unshift_1' (length=9) 1 => string 'a' (length=1) 2 => string 'b' (length=1) 3 => string 'c' (length=1) D:\wamp64\www\w0827pm\study.php:109: array (size=5) 0 => string 'unshift' (length=7) 1 => string 'a' (length=1) 2 => string 'b' (length=1) 3 => string 'c' (length=1) 'D' => string 'dd' (length=2) D:\wamp64\www\w0827pm\study.php:109: array (size=6) 0 => array (size=2) 0 => string 'unshift' (length=7) 1 => string 'unshift_1' (length=9) 1 => string 'a' (length=1) 2 => string 'b' (length=1) 3 => string 'c' (length=1) 'D' => string 'dd' (length=2) 4 => array (size=2) 0 => string 'unshift' (length=7) 1 => string 'unshift_1' (length=9)
mixed array_shift ( array array_shift() shifts the first value of the 1 $queue = array('a', 'b', 'c'); 2 array_shift($queue); 3 wb($queue); 4 $queue = array('a', 'b', 'c','D'=>'dd',array('shift','shift_1')); 5 array_shift($queue); 6 wb($queue); 7 echo '----------------------------<br>'; 8 $queue = array('a', 'b', 'c','D'=>'dd',array('shift','shift_1')); 9 w($queue[count($queue)-2]); 10 w(current($queue)); 11 w(next($queue)); 12 w(next($queue)); 13 array_shift($queue); 14 wb($queue); 15 16 function wb($w){ 17 w($w); 18 if (is_array($w)) { 19 w(current($w)); 20 } else { 21 w('! is_array(var)'); 22 } 23 } D:\wamp64\www\w0827pm\study.php:133: array (size=2) 0 => string 'b' (length=1) 1 => string 'c' (length=1) D:\wamp64\www\w0827pm\study.php:133:string 'b' (length=1) D:\wamp64\www\w0827pm\study.php:133: array (size=4) 0 => string 'b' (length=1) 1 => string 'c' (length=1) 'D' => string 'dd' (length=2) 2 => array (size=2) 0 => string 'shift' (length=5) 1 => string 'shift_1' (length=7) D:\wamp64\www\w0827pm\study.php:133:string 'b' (length=1) ---------------------------- D:\wamp64\www\w0827pm\study.php:133: array (size=2) 0 => string 'shift' (length=5) 1 => string 'shift_1' (length=7) D:\wamp64\www\w0827pm\study.php:133:string 'a' (length=1) D:\wamp64\www\w0827pm\study.php:133:string 'b' (length=1) D:\wamp64\www\w0827pm\study.php:133:string 'c' (length=1) D:\wamp64\www\w0827pm\study.php:133: array (size=4) 0 => string 'b' (length=1) 1 => string 'c' (length=1) 'D' => string 'dd' (length=2) 2 => array (size=2) 0 => string 'shift' (length=5) 1 => string 'shift_1' (length=7) D:\wamp64\www\w0827pm\study.php:133:string 'b' (length=1)
|
2022-08-30
2022-08-17
2022-11-06
2022-07-18
2022-08-18
请发表评论