Hi everyone,
I'm trying to user preg_replace and i tryed out a some sample code from php.net
<?php
$string = "April 15, 2003";
$pattern = "/(\w+) (\d+), (\d+)/i";
$replacement = "\${1}1,\$3";
print preg_replace($pattern, $replacement, $string);
/* Output
======
April1,2003
*/
?>
But the backreference \${1} just wont work. it sees it as plain tekst this is my output:
${1}1,2003
Can anyone help?
Pardon my bad english by the way im Dutch so 🙂