PHP Function Summary 2014.10.19

Source: Internet
Author: User

1, COUNT () alias sizeof (): count the number of cells in an array or the number of attributes in an object

<?php
$food
= Array ( ' Fruits ' = = Array ( ' Orange ' , ' Banana ' , ' Apple ' ),
' veggie ' = = Array ( ' Carrot ' , ' Collard ' , ' Pea ' ));

//Recursive count
Echo Count ( $food , count_recursive ); //Output 8

Normal count
Echo Count ( $food ); //Output 2

?>

2, Time (): Returns the number of seconds since the Unix era (00:00:00 GMT, January 1, 1970) to the current

3, Mt_rand (): Optional min parameters and max , mt_rand () return 0 to Mt_getrandmax () Pseudo-Random number Mt_rand (5, +)

4, Mt_getrandmax (): Returns the maximum number of random numbers that can be returned by calling Mt_rand ()

5. Move_upload_file (): move uploaded files to a new location

6, explode ('? ', $str): with? Split string

7, PathInfo ();

<?php
$path _parts
= PathInfo ( '/www/htdocs/inc/lib.inc.php ' );

Echo
$path _parts [ ' dirname ' ], "\ n" ;
Echo
$path _parts [ ' basename ' ], "\ n" ;
Echo
$path _parts [ ' extension ' ], "\ n" ;
Echo
$path _parts [ ' filename ' ], "\ n" ;
?>

Output:

/www/htdocs/inc lib.inc.php php Lib.inc8, Unipid (): Uniqid ([String $prefix = "" [, BOOL $mo Re_entropy = false]]) gets a unique ID with a prefix, based on the number of microseconds in the current time


This article is from the "Aidandai" blog, make sure to keep this source http://562097645.blog.51cto.com/9361855/1566103

PHP Function Summary 2014.10.19

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.