Php UDF for obtaining random array lists. php _ PHP Tutorial

Source: Internet
Author: User
Php implements a custom function to obtain the random array list, which is a php array. Php implements a user-defined function for obtaining the random array list. The php array is pasted with a piece of code. to obtain the random array in php, you don't need to say much. directly paste the code. the array_rand in php is abnormal, break through the custom functions in php to get the random array list, php array

Paste a piece of code. you don't need to say much about getting random arrays in php. directly paste the code. the array_rand in php is abnormal. it breaks through normal people's understanding and is tedious.

Function create_random_ids ($ min, $ max, $ limited) {$ _ base_ids = range ($ min, $ max); $ _ temp_key = array_rand ($ _ base_ids, min (count ($ _ base_ids), $ limited + 10); // splice $ ids = array (); for ($ x = 0; $ x <count ($ _ temp_key); $ x ++) {$ ids [] =$ _ base_ids [$ _ temp_key [$ x];} return $ ids ;}

The hacker posts a piece of code. it is unnecessary to get a random array in php. directly paste the code. the array_rand in php is abnormal, breaking through...

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.