PHP basic Knowledge "functions" (9) Math and object class functions

Source: Internet
Author: User
Tags deprecated

First, mathematics

ABS--Absolute value

Ceil--into a method to take the whole

Floor--The Rounding method

Fmod--Returns the remainder of the floating-point number for division

Round--Rounding a floating-point number

Sqrt--square root

Pi ()/m_pi--Get PI value

Is_nan--Judging whether it is a legal value

Is_finite--Determining whether a finite value

Is_infinite--Determine if the value is infinite

Max--Find out Max, Max (num1,num2,num3 ...), Max (Array (num1,num2,num3 ...))

Min--Find the minimum value, min (num1,num2,num3 ...), min (Array (num1,num2,num3 ...))

RAND ([int min, int max])--produces a random integer

Mt_rand ([int min, int max])--Generate a better random number

Mt_srand ([int seed])--sowing a better random number generator seed

Srand ([int seed])--Seeding the random number generator

Getrandmax--Displays the maximum possible value of the random number

Mt_getrandmax--Displays the maximum possible value of a random number

Ii. Objects and classes

1 , class of check

class_exists-checking whether a class is defined

method_exists-checking the existence of a class's methods

is_a-returns TRUE if the object belongs to the class or if the class is the parent class of this object

is_subclass_of-returns TRUE If this object is a subclass of the class

2 , get the name of the class

get_class-returns the "first name" of an object or class

Get_parent_class-returns the "parent class name" of an object or class

get_declared_classes-returns an array consisting of the names of the defined "classes"

3 , gets the properties of the type

Get_class_vars (string class_name)-Returns an array of "default Properties" for the class

get_object_vars-returns an associative array consisting of "Object Properties"

4 , get other

Get_class_methods (mixed class_name)-Returns an array consisting of the method name of the class

get_declared_interfaces-returns an array containing all declared "interfaces"

5 , abandoned

call_user_method_array-invokes a user method, passing a parameter array (deprecated)

Call_user_method-invoking a user method on a specific object (deprecated)

The class name and method name can be the same//

PHP basic Knowledge "functions" (9) Math and object class functions

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.