Home > Backend Development > PHP Tutorial > python - php数组前面部分拿到后面

python - php数组前面部分拿到后面

WBOY
Release: 2016-06-06 20:27:10
Original
1209 people have browsed it

python 的写法,loc4是一个很长的序列几十万吧,把前面11个拿到后面去

loc6 = loc4[len(loc4)-11:]+loc4[:len(loc4)-11]

php

改成php代码,数组合并,键值还是从0开始顺序,步进1

回复内容:

python 的写法,loc4是一个很长的序列几十万吧,把前面11个拿到后面去

loc6 = loc4[len(loc4)-11:]+loc4[:len(loc4)-11]

php

改成php代码,数组合并,键值还是从0开始顺序,步进1

<code>$loc6 = array_merge(array_slice($loc4, 11), array_slice($loc4, 0, 11));</code>
Copy after login

PS:Python代码是不是写错了

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template