PHP Common Functions Summary

Source: Internet
Author: User

PHP Common Functions Summary

string interception:

1, substr (' string to intercept ', ' starting from the first few characters ', ' to the end of the first few characters ');

* Capture English or digital

2, $cut = Explode (' to intercept a character in a string ', ' the string to intercept ');

//To intercept a string in a character array

substr ($cut [0], ' starting from the first few characters ', ' to the end of the first few characters ');

......

$SUBSTR ($cut [n], ' starting from the first few characters ', ' to the end of the first few characters ');

* Start interception from a character


string length:

1, strlen (' string ');

* Calculate the length of the string


Array and string conversions:

1,explode (' to intercept a character in a string ', ' the string to intercept ');

* String = array

2, implode (' array ');

* Number = string


Trade -Offs of decimal points:

1, round (' floating point number '); Rounded

Round (' floating point ', ' Number of decimal places '); Rounding (the number of digits set after the decimal point is retained)

* Rounding

2, Ceil (' floating point number '); As long as there are numbers in the decimal point,

* In a single rounding







The general functions of PHP are summarized above. Include aspects of the content, you want to be interested in PHP tutorial friends helpful.

  • Related Article

    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.