change the files name while that file is copying through source folder to destination folder in php?

AND I AM COPYING THESE FILES FROM SOURCE PATH TO DESTINATION PATH

src is a folder, and i have to change the name of files that are inside the folder.
Like :-

src/abc.css
abc.css to abc.src.css (abc.css is stored in src folder)

And also src folder contains sample folder and in that also files are there like my.css, to.css, eg.css and so on
src_foldder/sample_folder/my.css…….

and i have to change that also in my.src.css , to.src.css, eg.src.css and so on
how can i do this changes through php code? Please help.

if ($file == “css”) {
custom_copy($your textsrc . ‘/’ . $file, $dst .’/’.$file.’/’.’src’);
}

I WANT TO CHANGE THE NAME OF THE FILES WHILE OF AFTER COPYING FILES.
WHAT I HAVE TO IMPLEMENT IN THIS CODE.
I WANT TO USE PATHINFO FUNCTION, BUT CANT ABLE TO UNDERTAND HOW TO DO