Hi !
I was wondering if it is possible to replace the first half of matches using only preg_replace ?

Like i have
Code: 
[img=some1]
[img=some2]
[img=some3]
[img=some4]
PHP Code: 
$pattern='(\[img=(.*?)\])';
$test=preg_replace($pattern,'replaced',$test);
echo 
$test
The above code gives:
Code: 
[img=replaced]
[img=replaced]
[img=replaced]
[img=replaced]
RESULT WANTED
Code: 
[img=replaced]
[img=replaced]
[img=some3]
[img=some4]
PLS help !
Porsche_maniak Reviewed by Porsche_maniak on . preg_replace first half of matches ? Hi ! I was wondering if it is possible to replace the first half of matches using only preg_replace ? Like i have Rating: 5