如何在 PHP 中打印 "can't , doesn't , don't , .... "?

How to print "can't , doesn't , don't , .... " in PHP?

我想打印“我们找不到与您提供的信息匹配的电子邮件。”

但是PHP不会让我。有人知道怎么修这个东西吗 ?

`return Redirect::route('account-forgot-password')

->with('error','We can't find an email matching the information you provided. You may have entered an email that doesn't exactly match our records. Try again ');`

将单引号改为双引号

->with('error',"We can't find an email matching the information you provided. You may have entered an email that doesn't exactly match our records. Try again ");

或 将带有反斜杠的单引号字符更改为 ' 到 \'

->with('error','We can\'t find an email matching the information you provided. You may have entered an email that doesn\'t exactly match our records. Try again ');

你必须像这样转义字符:

echo('I don\'t like apples');

好吧,您可以将单引号更改为双引号,例如:

with("error","We can't find an email matching the information you provided. You may have entered an email that doesn't exactly match our records. Try again ");

你必须像with('error','We can\'t find an email matching the information you provided. You may have entered an email that doesn\'t exactly match our records. Try again ');

一样使用\'

每次键入单引号时发生的事情是关闭字符串,PHP 开始阅读以下文本作为代码。您可以通过使用双引号来包含整个字符串来避免这种情况:

->with("error","We can't find an email...");

或通过"escaping"单引号字符加反斜杠

->with('error','We can\'t find an email...');

您可以使用 PHP HEREDOC 语法,例如:

$errorMessage = <<<EOD
Example of string with ' and " :)
spanning multiple lines
using heredoc syntax.
EOD;

然后在您的函数中用作变量:

->with('error', $errorMessage);