有没有办法将变量传递给带有模式的php字符串

时间:2015-03-09 13:26:28

标签: php string

有没有办法以这种方式将模式传递给php字符串?

$pattern['first'] = "some text $var1";
$pattern['secound'] = "some text $var2";

$var1 = 10;
$var2 = 'text';

$string = " some text {$pattern['first']} some text {$pattern['secound'] = "some text $var2";}";

0 个答案:

没有答案