在
python我会这样做:
var = ["test","test1","test2","test3"]; test= var[1:3];
那么变量’test’将是[“test1”,“test2”,“test3”]
我如何在PHP中这样做?
那将是array_slice($var,1,3).参见:
http://php.net/manual/en/function.array-slice.php.
原文链接:https://www.f2er.com/php/138111.html完整的例子:
$var = array("test","test3"); $test = array_slice($var,3);