[PHP] Utility function 10_php Tutorial

Source: Internet
Author: User
Tags float number natural logarithm square root
Converts the character of an IP-point address back to the IP V4 format address

int Ip2long (string ip_address)
A string that converts an IP V4 format address back to an IP point sub-address

String Long2ip (int proper_address)
Gets the environment variable varname, succeeds returns the variable value, the failure is passed back false

String getenv (String varname)
Used to set the system environment

void Putenv (String setting)
Get the main name of the current PHP script

String Get_current_user (void)
Call Function_name the specified user function

String Get_cfg_var (String function_name[,mixed parrameter[,mixed ...])
Returns the port associated with the Service (protocol), which must be TCP or UDP

int Getservbyname (String service,string protocol)
Returns the service name (protocol) associated with port, which must be TCP or UDP

String Getservbyport (int port,string protocol)
Take absolute value

Mixed ABS (mixed number)
Open square root

float sqrt (float arg)
The quadratic value of the natural logarithm E

FLOAT exp (float arg)
return pi

Double pi (void)
Rounded

Double round (double val)
Calculates the smallest integer greater than the specified number

int Ceil (float number)
Calculates the maximum integer less than the specified

int floor (float number)
Take maximum value

Mixed max (mixed arg1,mixed arg2...mixed argn)
Take the minimum value

Mixed min (mixed arg1,mixed arg2...mixed argn)
Take a random number

int rand ([int min],[int Max])
Numbering conversion

String Base_convert (String number,int frombase,int tobase)
Formatting numeric strings

String Number_format (float number,int[decimals],string[decpoint],string[thounsands_sep])

http://www.bkjia.com/PHPjc/318591.html www.bkjia.com true http://www.bkjia.com/PHPjc/318591.html techarticle //Convert the character of the IP dot address back to the IPV4 format address Intip2long (stringip_address)///Convert the IPV4 format address back to the IP point sub-address string Stringlong2ip (intproper_address )//Get ring ...

  • 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.