Php-offset (starting at this distance from the end)

Source: Internet
Author: User
Keywords Php
Php

Array array_slice (array $array, int $offset [, int $length [, bool $preserve _keys]])
Array_slice () returns a sequence in an array of arrays specified by the offset and length parameters.

If offset is non-negative, the sequence starts at this offset in the array. If offset is negative, the sequence will start from this distance from the end of the array (what does that mean).
$input = Array ("A", "B", "C", "D", "E");
$output = Array_slice ($input,-1); Returns "E"

If the distance from the end of ' e ' begins to move left one, that should not be ' d '??

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.