Answer the question
In order to leave comments, you need to log in
PHP - variable and text, analogue of @ in C# ?
There is a piece of text with different quotes and line breaks, I would like to put it in a variable, is there a way to tell the interpreter not to take into account special characters inside the text?
Something like
[email protected]" <fdsfdsf sdfdf="" dsfsf=''>
<fdsfdsf sdfdf="" dsfsf=''>
<fdsfdsf sdfdf="" dsfsf=''>
<fdsfdsf sdfdf="" dsfsf=''>"
Answer the question
In order to leave comments, you need to log in
www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;
string addslashes ( string $str )
Returns a string with backslashes before characters that need to be quoted in database queries etc. These characters are single quote ('), double quote ("), backslash (\) and NUL (the NULL byte).
I did not understand your question a little, but you probably need to escape special characters.
$variable = "@";
echo ""; //1 вариант
echo '<fsdsfsd sdfds="' . "$variable" . '" dsfsds=\' \'>'; //2 вариант
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question