what's wrong with ereg_replace's \\1 ?

From: Date: Sun, 27 Aug 2000 15:52:21 +0000
Subject: what's wrong with ereg_replace's \\1 ?
Groups: php.general 
Request: Send a blank email to php-general+get-13844@lists.php.net to get a copy of this message
Hi, I have the following $string = "abcd °efgh äijklm". I need to replace the character entities with their numeric counterparts (XML requirement). I have a function transcript($entity, $map) that takes an $entity and returns the numeric equivalent if it exists. I thought I could do this: ereg_replace("&([^;]+);", transcript("\\1", $iso8859_1), $string); But apparently in this function call the "\\1" is taken literally ... Does anybody know I could achieve the same effect using another way? Thank you very much in advance, Jakob. PS: CC to me appreciated as I am on the digest list. Thanks.

« previous php.general (#13844) next »