String formatting functions commonly used in PHP

Source: Internet
Author: User

LTrim (): Remove spaces or other predefined strings from the left of a string
RTrim (): Deletes a blank string or other predefined character starting at the end of the string

Trim (): Removes white space characters and other predefined characters from both ends of a string


Str_pad (): Fills the string with a new length
Strtolower (): Converts a string to lowercase
Strtoupper (): Converts a string to uppercase

Ucfirst (): Capitalize the first character in a string


NL2BR (): Inserts an HTML line break before each new line of the string
Htmlentities (): Converting characters to HTML entities
Htmlspecialchars (): Convert some pre-defined characters to HTML entities
Stripslashes (): Remove backslash added by the addcslashes () function
Number_format (): Ability to format numbers by thousands of groups

Strip_tags (): Peel off html,xml and PHP tags


Strrev (): Invert string
MD5 (): MD5 calculation of a string
ucwords (): Capitalize the given word and first letter

String formatting functions commonly used in PHP

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.