如何将字符串中的 %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;
?>