What is the correct form to make $id
behave as a PHP variable inside the str_replace
command? I've tried wrapping the $id
inside with {
, or .
, but nothing helped. I'm not even sure how to define the problem I'm having here so I didn't really know how to Google this:
$id="Something";
$new = str_replace('?abc', '?id=$id&abc', $original);