Smarty Truncate intercept string//In SQL Truncate is delete table (truncate is delete content only, deletedeletes completely )Intercepts a length of characters from the beginning of a string, with a default length of 80Specifies the length of the
Parse the usage of the string function truncate in smarty. Smartytruncate intercepts a string from the start of the string. the default length is 80. specify the second parameter as the string length. by default, smarty intercepts
Smarty truncate
Smarty's usage of truncate {$ d. title | truncate: 25... the display is just a truncate. it seems that the numbers, various characters, and Chinese characters are treated as one character, but after all, two digits occupy the space of a Chinese
Recently, the project is always using truncate to intercept characters, but when the intercept UTF-8 often appears garbled, very annoying,
I decided to use the smarty plug-in to capture characters by myself. I would like to thank Zhu, a student
This article provides a detailed analysis of the usage of the string truncate function in smarty. For more information, see
Smarty truncate stringTruncates a certain length of characters starting from a string. the default length is 80.
Specify the
Detailed usage of the truncate of smarty ..... Ask: What is the usage of smarty's truncate? Why is the difference between the length of the captured characters and the actual captured characters so far ?? Template code: {$ title | truncate: 15} & lt;
Detailed usage of the truncate of smarty ..... Ask: What is the usage of smarty's truncate? Why is the difference between the length of the captured characters and the actual captured characters so far ?? Template code: {$ title | truncate: 15} & lt;
The answer is: when the server uses the php feature (function) to include any file, the source of the file to be included is not strictly filtered, so that it can contain a malicious file, we can construct this malicious file to achieve the evil
There are a lot of ways to install extensions to PHPFirst, recompileEnter the PHP source directory./configure--prefix=/usr/local/php ... [Other compilation parameters]Ii. adding extensions via PhpizeEnter the PHP source extension application
How to use PHP, dynamically truncate the string "1|10,2|11,3|12" in the section between the | and, number, including |?
Reply to discussion (solution)
Str_replace (",", "", "Str_replace (" | "," ", $val)) can be replaced
$s = "1|10,2|11,3|12
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.