It does not modify data. Why ???
$game="text (out (in1 in2) out2"; $variation="in";
echo $game. " <BR> \n"; echo " <BR> \n";
preg_replace("% $variation %x",'WW', $game);
echo $game. " <BR> \n";
You need to redefined the $game variable:
$game = preg_replace("% $variation %x","WW", $game);
That should work.
I don't know what your end application is, but you could also use the following:
$game = str_replace($variation, "WW", $game);