Prime partner of uset (OJB) and array_values (array) Functions

Source: Internet
Author: User
ArticleDirectory
    • Syntax

Introduction: This is a detailed page between uset (OJB) and array_values (array) functions. It introduces PHP, related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 329766 'rolling = 'no'>

After uset (array), the index value in the array remains unchanged, and the corresponding value is empty.

So we can use the array_values (array) function to re-generate the index of the array (in the order of 0... n). Otherwise, we will have trouble using the array time.

Array_values definition and usage

The array_values () function returns an array containing all the key values in the given array without retaining the key name.

Syntax
 
Array_values (array)
Parameters Description
Array Required. Specifies the given array.
Tips and comments

Tip: The returned array uses the value Key, starting from 0 and increasing by 1.

Example
<? PHP $ A = array ("A" => "cat", "B" => "dog", "C" => "horse "); print_r (array_values ($ A);?>

Output:

 
Array ([0] => CAT [1] => dog [2] => horse

More articles about "golden partner of uset (OJB) and array_values (array) functions"

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/329766.html pageno: 12.

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.