I have a function and within the function I have:
$clean_dir = str_replace("temp_images/".$foldername."/output/", "", $dir);
$foldername value is outside the function.
When I run the above temp_images/xyz/output remains temp_images/xyz/output, but then I replace temp_images/xyz/output with xyz directly instead of $foldername. then it changes.
How can I insert mixed text with a variable in str_replace?
Thanks