L
L
Lakewake2011-07-30 10:32:31
PHP
Lakewake, 2011-07-30 10:32:31

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

4 answer(s)
M
Maxim, 2011-07-30
@vedmaka

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;

S
shagguboy, 2011-07-30
@shagguboy

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).

M
masterrr, 2011-07-30
@masterrr

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 вариант

L
Lakewake, 2011-07-30
@vedmaka

see the first answer, you misunderstood the question

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question