Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于模板消息换行的问题 #266

Closed
BelinChung opened this issue Jan 25, 2016 · 3 comments
Closed

关于模板消息换行的问题 #266

BelinChung opened this issue Jan 25, 2016 · 3 comments

Comments

@BelinChung
Copy link

按照官方的文档,建议使用 \n 来进行换行
不过,我使用过程中,好像被转义了,直接显示了出来?

$data = array(
    "first"    => array("\n恭喜你购买成功!\n", '#555555'),
);
@overtrue
Copy link
Collaborator

@BelinChung 刚刚试了一下:

$data = [
     "first"    => "恭喜你\n购买成功!",
     "name" => "巧克力",
     "price" => "39.8元",
     "remark"   => "欢迎再次购买!",
];

没啥问题:

qq20160125-0 2x

@BelinChung
Copy link
Author

        So  so sorry.我是前端工程师,这几天私人项目里自己写PHP..以前项目规范字符串都必须是单引号的,写PHP的时候写顺手了,不知道是不是这个原因。
        在2016年01月25日 20:37,安正超 写道:@BelinChung 刚刚试了一下:

$data = [
"first" => "恭喜你\n购买成功!",
"name" => "巧克力",
"price" => "39.8元",
"remark" => "欢迎再次购买!",
];

没啥问题:

—Reply to this email directly or view it on GitHub.

@overtrue
Copy link
Collaborator

@BelinChung PHP里双引号才会解析转义符

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants