Most Helpful
Most Helpful
You can use double quoted strings, variables in scope will be replaced automatically.
See here for more details: www.php.net
See here for more details: www.php.net
0
$string = "My string";
$needle = "string";
$replace = "replaced var";
echo str_replace($needle,$replace,$string)
Is this what you want? Or this:
$var = 'special string';
echo "I'm echoing a $var";// Output: I'm echoing a special string
$needle = "string";
$replace = "replaced var";
echo str_replace($needle,$replace,$string)
Is this what you want? Or this:
$var = 'special string';
echo "I'm echoing a $var";// Output: I'm echoing a special string
0
0
Need more information.
I assume your doing something more complicated than:
$var = 'paul';
echo 'this person is ill today: ' . $var;
I assume your doing something more complicated than:
$var = 'paul';
echo 'this person is ill today: ' . $var;