The dedecms screenshot can be directly written in the template as follows: [field: title? Functioncn_substr (@ me, 16)] indicates the specific usage of titlecn_substr: function: Specifies the length of the string to be intercepted by the string $ str, single-byte truncation mode. A Chinese Character occupies 2 bytes $ s
The dedecms screenshot can be directly written in the template as follows: [field: title? Function = "cn_substr (@ me,'', 16) "/] indicates the specific use of the title cn_substr: function: intercept Chinese string parameters: $ str = string to be intercepted $ slen = length to be intercepted. in single-byte truncation mode, a Chinese character occupies 2 bytes $ s
Dedecms interceptions can be directly written in the template.
As follows:
[Field: title? Function = "cn_substr (@ me,'', 16) "/]
Indicates the specific usage of intercepting title cn_substr:
Function:Truncate a Chinese String
Parameters:
$ Str ="String to be intercepted
$ Slen ="The length to be intercepted. It is a single-byte truncation mode. A Chinese Character occupies 2 bytes.
$ Startdd = 0Mark the start position of the truncation. The default value is 0 and starts from scratch.
Return Value:
Returns the truncated string. An error returns a null string.
Mysql Field Truncation update statement
UPDATE 'kdu _ archives' SET 'title' = substring ('title', 10)
The function is to update all content of the title and retain the content by length.
These interceptions may be very useful when collecting large volumes of content ~
Original article address: fixed content of dedecms interception and mysql interception fields. Thanks to the original author for sharing.