PHP Common functions

Source: Internet
Author: User
Tags base 10 logarithm binary to decimal decimal to binary http cookie natural logarithm setcookie square root value of pi

<?php

Setcookie (name,value,expire,path,domain,secure): function sends an HTTP cookie to the client.

Domain: Optional, specify the name of the cookie

Secure: Optional rules whether to transfer cookies via secure HTTPS links


Setrawcookie (name,value,expire,path,secure): The function does not URL-encode the cookie, sending an HTTP cookie, as is the case with Setcookie.


Mail (to, subject, message,headers,parameters): function allows e-mail to be sent directly from the script


ABS: The function returns the absolute value of a number


ACOs (ARG): function returns the inverse cosine of a number, x between 1 and 1;


Acosh (x): Returns the inverse hyperbolic cosine of a number


ASIN (x) returns a number of the inverse of the chord


Asinh (): function returns the inverse hyperbolic sine of a number


Atan (ARG): function returns the inverse tangent of a number, the return value between-PI/2 and PI/2


Atan2 (y, x): function returns the inverse tangent of two parameters, the return value between-pi and pi


Atanh (ARG): function returns inverse hyperbolic tangent of an angle


Base_convert (number, frombase, tobase): functions are converted between arbitrary binaries

eg $oct = "0031";

$dec = Base_convert ($oct, 8,10);

echo "octal $oct equals the decimal $dec. ";


Bindec (binary_string): Converting binary to 10 binary


Ceil (value): function rounded up to the nearest integer


Cos (ARG): function returns the cosine of a number


Cosh (ARG): function returns the hyperbolic cosine of a number


Decbin (number): The function converts decimal to binary


Dechex (number): function converts decimal to 16 binary


DECOCT (number): function converts decimal into octal


Deg2rad (number): function converts angle to radians


Exp (ARG): function calculates the exponent of E


EXPM1 (ARG): The function returns exp (x)-1, which is equivalent to the value of X close to 0 to calculate the exact result.


Floor (Value): function is rounded down to the nearest integer


Fmod (x, y): function returns the floating-point number of division


Getrandmax (): function shows the maximum possible value of a random number


Hexdec (hex_string): function converts 16 binary to decimal


Hypot (x, y); function calculates the length of a triangular hypotenuse


Is_finite (val): function to determine whether it is a finite value


Is_infinite (val): Determines whether it is an infinite value


Is_nan (val): Determines whether a non-numeric


Log (X,base): Returns base x logarithm if base is specified, otherwise fan Hu natural logarithm


LOG10 (ARG): Returns the base 10 logarithm


LOG1P (number), returns log (1+X), even when the value of x is close to 0 o'clock to calculate the exact result


Max (x, y): Returns the largest of the parameters, can make multiple values, or it can be an array

Note: PHP treats non-numeric strings as 0, but if this is the maximum value, it will still return a string. If more than one parameter evaluates to 0 and is the maximum, max () returns 0 of the value, and if there is no value of 0 in the argument, the string that is the largest in alphabetical order is returned.


Min (x, y): Returns the minimum value in the parameter, as follows


Mt_rand (Min,max): Returns a random integer using the Mersenne twister algorithm


Octdec (octal_string): convert octal to 10 decimal


PI (): Returns the value of pi


POW (base, exp), returns the value of the exp sub-square of base


Rad2deg (number): Converts radians to angles


Rand (MIN,MAX): function returns random integer


Round (X,pec): function rounds floating-point numbers, x specifies the number to round, PREC, and optionally specifies the number of digits after the decimal point

Can make 0 (default) or negative


Sin (x): function returns the sine of a number


Sinh (ARG): function returns the inverse hyperbolic sine of a number


sqrt (ARG): function returns the square root of a number


Tan (ARG): Tangent


Tanh (ARG): Hyperbolic tangent








?>


This article is from "Tiger Brother's Blog" blog, please be sure to keep this source http://7613577.blog.51cto.com/7603577/1533474

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.