Echo () is not a function, print () is a function, has a return value, boolen,false,true;
printf () Formatted output
--function, the format of the text after the output, directly call the system call for IO, he is not buffered. Such as:
$name = "Hunte";
$age = 25;
printf ("My name was%s, age%d", $name, $age);
sprintf () Formats the string and assigns it to a variable, but does not output, similar to C.
-Similar to printf, but does not print, but returns the formatted text, and others are the same as printf. Such as:
Char sql[256];
sprintf (SQL, "select * FROM table where no = '%s '", Bankno);
Its function is simply to assign "" inside the statement to the variable SQL.
Strtolower
Strtoupper
Ucwords
Ucfirst
2. Connection and segmentation of strings
(1) array explode (string input, string separator, int limit)
$test = "Your customer service is excellent";
Echo substr ($test, 1);////////our customer service is excellent
echo "<br>";
Echo substr ($test,-9);//////from the end length is 9excellent
echo "<br>";
Echo substr ($test, 0,4)////starting from 0 position length is 4Your
echo "<br>";
Echo substr ($test, 5,-13);/from start fourth to last 13th character customer service
echo "<br>";
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.