Strtoupper (), Strtolower (), Ucfirst (), Ucfirst (), Ucwords (), Mb_strtoupper (), Mb_strtolower (), and Mb_convert_case () These eight functions differ and relate to:
Function name
Scope of Use
Function
Note: The string functions that are provided in PHP are mostly not modified on the original string, but instead return a new formatted string.One, take out space and string fill functionA space is also a valid character and occupies a position in
PHP$a= "@[email protected]"; $trim=Trim($a,‘@‘);//Remove the @//var_dump ($trim) on the left and right side; $ltrim=LTrim($a,‘@‘);//Remove the @//var_dump ($ltrim) on the left; $rtrim=RTrim($a,‘@‘);//Remove the @//var_dump ($rtrim) on the
This article mainly introduces the summary of common string formatting functions in PHP. the functions described in this article are frequently used on the WEB, for example, functions such as space filling and string filling, case-sensitive
(1) the first two functions of echo, print, printf, and sprintf are output strings. if there is a variable name in the string, it is replaced with its value. the last two functions are similar to C functions with the same name. (2) strchr, strlen,
Summary of php5 string processing functions, which are frequently used by php users. Easy to search and use. Addcslashes-add backslash escape characters to some characters in the string
Addslashes-escape characters in the string in the specified
Converts the first letter of each word in a php string to uppercase:
Ucwords ()
$ Foo = 'Hello world! ';$ Foo = ucwords ($ foo); // Hello World!$ Bar = 'Hello WORLD! ';$ Bar = ucwords ($ bar); // hello world!$ Bar = ucwords (strtolower ($ bar);
This article mainly introduces the summary of common string formatting functions in PHP. The functions described in this article are frequently used on the WEB, for example, the function of filling spaces and strings, converting strings in case, and
Before we tell you how to convert the case of a string, there are times when we don't need to completely capitalize or lowercase the letter of the string, but just need to convert the first letter of the string to uppercase or lowercase.
So, this
PHP get Pinyin First letter
After the program runs, it is found that some text in the string cannot be converted. If you enter these words individually, you can read and remove the phonetic opening letters directly by converting them.
It doesn't
Analysis on the working principle and usage of the srbac permission extension module in Yii, yiisrbac
This document describes how the srbac permission extension module works in Yii. We will share this with you for your reference. The details are as
This article illustrates the working principle and usage of SRBAC permission extension module in Yii. Share to everyone for your reference, specific as follows:
1. Set permission rules table: can be placed in module modules configuration file
PHP is a very high degree of freedom programming language. It's a dynamic language and has a lot of latitude for programmers. As a PHP programmer, you need to know a lot of specs to make your code more efficient. For many years, I have read many
addcslashes-to add a backslash escape character for some characters inside a string
Addslashes-the characters inside a string in a specified manner
bin2hex-converts binary data to hexadecimal representations
alias function for Chop-rtrim
First, the file upload
1, client settings:
(1), in
Label Enctype and method two properties to indicate the corresponding values.
Enctype= "Multipart/form-data"; Method= "POST"
(2), form form to set up a hidden type of input box, where the value
This example implements the effect that when you select a programming language from the Select Drop-down box, depending on the options, asynchronous requests for different function APIs are described, and the required friends can refer to the
This article mainly introduces the PHP implementation string first letter conversion to uppercase method, involving PHP Ucfirst and ucwords function of the use of skills, need friends can refer to the
The example in this article describes the
function | The string manipulation function in string PHP3.0 is much more important for the following:
(1) echo,print,printf,sprintf
is used for output strings. If a variable name is substituted in the string, it is replaced with its value.
1, AddslashesAddslasehes ($string) to compile and escape a stringApplication scenario: can prevent SQL injection (of course, it is not entirely possible, we can use PDO for preprocessing and then SQL injection, security can not only one way to
Mathematical functions1.abs (): Absolute value$abs = ABS (-4.2); 4.2 Numeric Absolute number2.ceil (): Into a method to take the wholeecho ceil (9.999); 10 floating point number in one rounding3.floor (): Rounding off the Rounding methodecho Floor (9
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.