Bir dizideki anahtarların unset aralığı

2 Cevap php

70 Böyle bir dizide 80 söylemek arasında Nasıl anahtarları bir dizi unset olabilir?

[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

2 Cevap

Bu bir kısayol gerçekten yok:

for ($i = 70; $i <= 80; $i++)  
    unset($array[$i]);

Sen array_slice deneyebilirsiniz

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

o zaman

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

veya

array_splice

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