欧美AV无码一区二区,麻豆+无码+国产在线+观看,欧美狂躁少妇XXXX高潮无码,美女扒开屁股让男人桶免费观看,极品粉嫩国产18尤物在线播放

Ds\Map::slice

(PECL ds >= 1.0.0)

Ds\Map::slice Returns a subset of the map defined by a starting index and length

說(shuō)明

public Ds\Map::slice(int $index, int $length = ?): Ds\Map

Returns a subset of the map defined by a starting index and length.

參數

index

The index at which the range starts.

If positive, the range will start at that index in the map. If negative, the range will start that far from the end.

length

If a length is given and is positive, the resulting map will have up to that many pairs in it. If a length is given and is negative, the range will stop that many pairs from the end. If the length results in an overflow, only pairs up to the end of the map will be included. If a length is not provided, the resulting map will contain all pairs between the index and the end of the map.

返回值

A subset of the map defined by a starting index and length.

范例

示例 #1 Ds\Map::slice() example

<?php
$map 
= new \Ds\Map(["a" => 1"b" => 2"c" => 3"d" => 4"e" => 5]);

// Slice from 2 onwards
print_r($map->slice(2)->toArray());

// Slice from 1, for a length of 3
print_r($map->slice(13)->toArray());

// Slice from 1 onwards
print_r($map->slice(1)->toArray());

// Slice from 2 from the end onwards
print_r($map->slice(-2)->toArray());

// Slice from 1 to 1 from the end
print_r($map->slice(1, -1)->toArray());
?>

以上例程的輸出類(lèi)似于:

Array
(
    [c] => 3
    [d] => 4
    [e] => 5
)
Array
(
    [b] => 2
    [c] => 3
    [d] => 4
)
Array
(
    [b] => 2
    [c] => 3
    [d] => 4
    [e] => 5
)
Array
(
    [d] => 4
    [e] => 5
)
Array
(
    [b] => 2
    [c] => 3
    [d] => 4
)
欧美AV无码一区二区,麻豆+无码+国产在线+观看,欧美狂躁少妇XXXX高潮无码,美女扒开屁股让男人桶免费观看,极品粉嫩国产18尤物在线播放