This is very weird...
I have this piece of code:
It produces:
The $1 ('needle=') part is gone, as is the first digit of $iNewNeedle...?!?
(I know that in this case I don't really need the $1, but it is just a (simple) example.)
I tried ${1}, \1 and I tried just concatenating the strings ($1 . $sNewNeedle) all of which don't work.
I am completely out of ideas here...
Does everybody experience this on their system..?!?
Is this a bug..?!?
Or am I just missing something very obvious (which usually is the case... ;-) ).
(My PHP version is 5.1.6 on RedHat Linux kernel 2.6.18)
Thanks!
I have this piece of code:
Code:
<?php
$sString = "abc abc needle=567 def def";
$iNewNeedle = 123;
print preg_replace("/(needle=)[0-9]+/", ">> $1$iNewNeedle <<", $sString);
?>
It produces:
Code:
abc abc >> 23 << def def
The $1 ('needle=') part is gone, as is the first digit of $iNewNeedle...?!?
(I know that in this case I don't really need the $1, but it is just a (simple) example.)
I tried ${1}, \1 and I tried just concatenating the strings ($1 . $sNewNeedle) all of which don't work.
I am completely out of ideas here...
Does everybody experience this on their system..?!?
Is this a bug..?!?
Or am I just missing something very obvious (which usually is the case... ;-) ).
(My PHP version is 5.1.6 on RedHat Linux kernel 2.6.18)
Thanks!