This article mainly introduces the DedeCms custom field call length interception method. Friends in need can refer to it.
For example, the called field is test
dedecms template download address: www.php.cn/xiazai/code/dedecms
Method 1: Run phpmethod...
[field:test runphp=yes] @me= substr (@me,截取字节) [/field:test]
Method 2: Call built-in Function method
[field:test function=’cn_substr(@me,截取字节)’/]
The two methods are actually almost the same.
The second method is more suitable for Chinese interception. It is the built-in function encapsulated by dedecms
The effect is much better than the first one...
The above is the detailed content of Two methods for length interception of DedeCms custom field calls. For more information, please follow other related articles on the PHP Chinese website!