实例首页
自学教程
IT工具箱
源代码
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>PHP array_slice() 实例 - 自学教程(runoops.com)</title> </head> <body> <?php $a=array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow","e"=>"brown"); print_r(array_slice($a,1,2)); $a=array("0"=>"red","1"=>"green","2"=>"blue","3"=>"yellow","4"=>"brown"); print_r(array_slice($a,1,2)); ?> </body> </html>
运行结果: