array_shift but preserve keys

前端 未结 4 1176
小鲜肉
小鲜肉 2021-01-17 09:41

My array looks like this:

$arValues = array( 345 => \"jhdrfr\", 534 => \"jhdrffr\", 673 => \"jhrffr\", 234 => \"jfrhfr\" );

How

4条回答
  •  遇见更好的自我
    2021-01-17 09:59

    // 1 is the index of the first object to get
    // NULL to get everything until the end
    // true to preserve keys
    $arValues = array_slice($arValues, 1, NULL, true);
    

提交回复
热议问题