%xxx を文字列内の $xxx に置き換える方法は?
<?php
// how to replace the %xxx to be $xxx
define('A',"what are %a doing, how old are %xx ");
$a='hello';
$xx= 'jimmy';
$b= preg_replace("@%([^\s])@","${$1}",A); //error here;
// should output: what are hello doing,how old are jimmy
echo $b;
?>