Home >Backend Development >PHP Tutorial >What are the PHP string filtering and conversion functions?

What are the PHP string filtering and conversion functions?

WBOY
WBOYOriginal
2016-07-25 08:54:191026browse
Share several useful PHP string filtering and conversion functions for safe processing of characters and string processing.

Includes the following string filtering and conversion functions:

nl2br();// n to

addslashes(); stripslashes();//Escape special characters when operating on the database

chop();//Remove spaces on the right side of the string trim();//Remove all spaces in the string ltrim();//Remove spaces on the left side of the string

htmlspecialchars(); //Convert '$', '"', '' to corresponding html entities htmlentities();//Convert all html tags into corresponding html entities

array explode(string separator, string str);//Split string string implode(string separator, array arr);//Connect strings

strtoupper(); strtolower();//Convert case ucfirst();//Convert only the first character to uppercase ucwords();//Convert the first letter of each word to uppercase



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn