If you
$a = 'World'
$str = 'Hello '.$a
$a = ' John Doe'
Is there a way in PHP that $str
will now get the changed value from $a
? I know that I get: $str = 'Hello World'
what I would like:$str = 'Hello John Doe'
I know this can be done by replacing the old value with str_replace, but I would like to ask if there is a way to pass this var by reference or something like that.
source
share