Home >Backend Development >PHP Tutorial >Two methods for length interception of DedeCms custom field calls

Two methods for length interception of DedeCms custom field calls

黄舟
黄舟Original
2017-03-31 10:10:471723browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn