PHP中数组键必须是数,php-数组中未设置键的范围

我如何在这样的数组中取消设置介于70到80之间的键范围?

[63] => Computer Science and Informatics

[64] => Dentistry

[65] => Development Studies

[66] => Drama, Dance and Performing Arts

[67] => Earth Systems and Environmental Sciences

[68] => Economics and Econometrics

[69] => Education

[70] => Electrical and Electronic Engineering

[71] => English Language and Literature

[72] => Epidemiology and Public Health

[73] => European Studies

[74] => French

[75] => General Engineering and Mineral & Mining Engineering

[76] => Geography and Environmental Studies

[77] => Geography and Environmental Studies

[78] => German, Dutch and Scandinavian Languages

[79] => Health Services Research

[80] => History

[81] => History of Art, Architecture and Design

[82] => Iberian and Latin American Languages

[83] => Infection and Immunology

[84] => Italian

[85] => Law

[86] => Library and Information Management

[87] => Linguistics

[88] => Mechanical, Aeronautical and Manufacturing Engineering

[89] => Metallurgy and Materials

[90] => Middle Eastern and African Studies

解决方法:

$return = array_slice($original, 0, 60)

然后

$return = $return+array_slice($original, 70)

要么

$return = array_splice($original, 60, 10)

标签:unset,php,arrays,key

来源: https://codeday.me/bug/20191011/1889093.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值