PHP Filter String Specific methods introduction _php Tutorial

Source: Internet
Author: User
Tags chop
We all know that.Example code for PHP filtering strings:

  1. < ? PHP
  2. NL2BR ();
  3. //N to <br/>
  4. Addslashes (); Stripslashes ();
  5. Escape special characters when working against a database
  6. Chop ();
  7. Remove the right space from the string
  8. Trim ();
  9. Remove all spaces in a string
  10. LTrim ();
  11. Remove the left space of a string
  12. Htmlspecialchars ();
  13. //Convert ' $ ', ' ' ', ' < ',' > ' for the corresponding HTML entity
  14. Htmlentities ();
  15. Convert all HTML tags to the appropriate HTML entity
  16. Array explode (string separator, string str);
  17. Split string
  18. String implode (string separator, array arr);
  19. Connection string
  20. Strtoupper (); Strtolower ();
  21. Convert case
  22. Ucfirst ();
  23. Convert only the first character to uppercase
  24. Ucwords ();
  25. Convert the first letter of each words to uppercase
  26. ?>

I hope that this article introduces the PHP filter string method can be in-depth grasp this point of knowledge.


http://www.bkjia.com/PHPjc/446234.html www.bkjia.com true http://www.bkjia.com/PHPjc/446234.html techarticle We all know the code example of PHP filtering string: Php nl2br ();//nto br/addslashes (); stripslashes ();//When operating on a database, Escape special characters chop ();//Remove string right ...

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