I have this copy function
$srcfile='C:\xampp\htdocs\imagenes\M1001.jpg';
$dstfile='C:\xampp\htdocs\imagenes-copiadas\M1001.jpg';
mkdir(dirname($dstfile), 0777, true);
copy($srcfile, $dstfile);
I need the name M1001.jpg to be a variable called = $ image.jpg I tried double quotes, double \, single bar and double bar for variable \ $ image, and it does not work.
I tried this:
$srcfile='C:\xampp\htdocs\imagenes\$imagen.jpg';
$dstfile='C:\xampp\htdocs\imagenes-copiadas\$imagen.jpg';
mkdir(dirname($dstfile), 0777, true);
copy($srcfile, $dstfile);
but it does not work