I'm trying to use numeric literals with my array $test with preg_replace in PHP, there is what I got:
$test["a"] = "hey";
// Find a as $0
echo preg_replace("/[a-z]/", "Found:$0", "a")."\n";
// Can replace it by "hey"
echo preg_replace("/[a-z]/", $test['a'], "a")."\n";
// Can't replace it :/
echo preg_replace("/[a-z]/", $test["$0"], "a")."\n";
As you see, the last preg_replace function doesn't work, whereas the two others work fine... I tried a lot of times to include the $0 with various tricks, but nothing stills work... Can you help me, please?