Can't escape characters in php??
| From: | Lars Espelid | Date: | Thu, 14 Nov 2002 20:59:27 +0000 |
| Subject: | Can't escape characters in php?? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-124534@lists.php.net to get a copy of this message | ||
Hello,
I'm running Apache/1.3.26 and PHP 4.0.5 on WinXP pro.
The following code is taken from the book mastering PHP 4.1 and is supposed
to work:
if (ereg([^0-9], "2002-11-14"))
print "That's not a number!";
It won't work for me. I get a parse error expecting a ')'.
I have also tried other regular expressions, but almost all of them fails.
One that works: if (ereg("....-..-..", "2002-11-14"))
Also '\n' in an echo-expression won't work. It is ignored.
code:
echo "HELLO \n";
echo "WORLD";
result:
HELLO WORLD
What can be wrong? Do I miss a library or something??
Thanks,
Lars