Two methods for length interception of DedeCms custom field calls

黄舟
Release: 2023-03-07 08:20:01
Original
1690 people have browsed it

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]
Copy after login

Method 2: Call built-in Function method

[field:test function=’cn_substr(@me,截取字节)’/]
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template