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

关于wechat类文本回复的换行问题(BUG) #359

Open
joyokim opened this issue Jul 29, 2018 · 1 comment
Open

关于wechat类文本回复的换行问题(BUG) #359

joyokim opened this issue Jul 29, 2018 · 1 comment

Comments

@joyokim
Copy link

joyokim commented Jul 29, 2018

	/**
	 * 过滤文字回复\r\n换行符
	 * @param string $text
	 * @return string|mixed
	 */
	private function _auto_text_filter($text) {
		if (!$this->_text_filter) return $text;
		return str_replace("\r\n", "\n", $text);
	}

以上为实现文本消息回复的换行,其中str_replace("\r\n", "\n", $text);是无法识别到\r\n.

正确应为
return str_replace("\\r\\n", "\n", $text);

@landall
Copy link

landall commented Nov 30, 2018

人家不是那个意思,不是让你用字符写\r\n这四个字符的,只是不要用windows的换行符而已。

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