problem with < in a variable
Posted: Tue Dec 28, 2010 1:01 pm
Hi
I am having some problems with variables, hope that someone can help me out with this.
example code:
$a = "test";
$b = "<test>";
echo "$a"; -- prints: test
echo "$b"; -- prints: <nothing>
So as soon as I add "<" to the variable the variable is blank for some odd reason.
I have tried to escape it with \ but that doesn't make any difference, the $b will then only print \ and nothing else.
Running: PHP Version 5.2.6-2ubuntu4.6
Any suggestions?
I am having some problems with variables, hope that someone can help me out with this.
example code:
$a = "test";
$b = "<test>";
echo "$a"; -- prints: test
echo "$b"; -- prints: <nothing>
So as soon as I add "<" to the variable the variable is blank for some odd reason.
I have tried to escape it with \ but that doesn't make any difference, the $b will then only print \ and nothing else.
Running: PHP Version 5.2.6-2ubuntu4.6
Any suggestions?