Common but useful functions in php

Source: Internet
Author: User
. Array_flip ($ arr); W3C explains that the function returns an inverted array. if the same value appears multiple times, the last key name is used as its value, all other key names will be lost. If the data type of the value in the original array is not a string or integer, the function reports an error.

1. array_flip ($ arr); W3C explains that the function returns an inverted array. if the same value appears multiple times, the last key name is used as its value, all other key names will be lost. If the data type of the value in the original array is not a string or integer, the function reports an error.

 

 1, "B" => 1, "c" => 2); $ trans = array_flip ($ trans); print_r ($ trans);?>
 

The result is:

Array ([1] => B [2] => c)

2. mkdir (path, mode, recursive, context) describes its third parameter: recurisive is required and specifies whether to set the recursive mode. For example, I want to create E: \ abc \ AB \ c (three folders abc \ AB \ c do not exist ).

 

 

In this way, the directory will be created cyclically.

 

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.