我有一个问题。我使用屏幕传递数据并生成电子邮件,字符串格式是这样的。
/var/lib/asterisk/agi-bin/scllevel/email.php '20' '2012-08-08 12:00:43' 'bhavik.patel@gmail.com' 'For Less Attendances' '"<p>\r\n\tFor late Coming<\/p>\r\n1111111111111111\r\ntesting this is testing's this is \"Testing\"\r\n"' '178' '22' 'info@broadcast.com'
我有一个问题,比如在单引号中,身体部位没有正确设置,它们的行为与我的身体部分开始的不同命令
"<p>['\r\n\tFor late Coming<\/p>\r\n1111111111111111\r\ntesting this is testing's this is \"Testing\"\r\n"]
如果任何用户正文是这样的,那么问题将被创建,所以对此有任何想法。我已经使用了像htmlentities,addcslashes和stripslashes这样的PHP函数,但是徒劳无功。
答案 0 :(得分:1)
您的问题是您要删除斜杠。你的php用斜线字符串获取邮件,你需要做的是使用“stripslashes
”将斜线字符串转换为非削减字符串,例如。
您需要在字符串ASCII表示中简单地将“\r
”-s转换为0x10
-s。
htmlentities
和其他功能不需要这个简单的任务。
如果还不够,请将您的email.php粘贴到此处,我会检查一下。