> ## Content Index
> Fetch the complete content index at: https://blog.k3s.9zf.net/llms.txt
> Use this file to discover other available public pages before exploring further.

# 帝国CMS 截取和替换字段
- URL: https://blog.k3s.9zf.net/-e5-b8-9d-e5-9b-bdcms--e6-88-aa-e5-8f-96-e5-92-8c-e6-9b-bf-e6-8d-a2-e5-ad-97-e6-ae-b5/
- Published: 2017-05-17T20:50:04.000Z
- Updated: 2017-05-17T20:50:04.000Z
- Author: liu
- Tags: 生活日记, #wordpress, #Import 2026-10-29 06:11

> <?=esub(str\_replace(“|”,” “,$bqr\[test\]),10)?>

具体解析：

$bqr\[test\] 代表灵动标签调用字段test

str\_replace(“|”,” “,$bqr\[test\] 代表替换结果中的“|”为空

esub(str\_replace(“|”,” “,$bqr\[test\]),10) 代表截取10个字符

<?=esub(str\_replace(“|”,” “,$bqr\[test\]),10)?> 代表模板内插入这段PHP功能代码的开始和结束

注意单引号和双引号被wordpress转义