이런 배열에서 70에서 80 사이의 키 범위를 어떻게 해제 할 수 있습니까? [63] => Computer Science and Informatics
[64] => Dentistry
[65] => Development Studies
[66] => Drama, Dance and Performing Arts
[67] => Earth Systems and
unset()을 사용한 후에 배열 순서를 잃는 데 약간의 문제가 있습니다. 여기서 먼저 코드이다 : $id = $_GET['id'];
for($i = 0; $i < count($my_array); $i++)
{
if($my_array[$i] == $id)
{
unset($my_array[$i]);
}
}
은 $
내부 소자 있지만 해제() 함수는 보이지 않는다 작동한다 : foreach ($this->result['list'] as &$row) {
if ($this_row_is_boring) {
unset($row);
}
}
print_r($this->result['list']); // Includes rows I thought I
나는 내가 가지고있는 문제에 대한 간단한 데모를 만들었습니다. 이것은 정확하게 구현하는 방법이 아니지만 같은 결과로 이어지는 것 같습니다. <?php
class mainclass {
var $vardata = array();
function &__get ($var) {
if ($this->vardata[$var]) ret