Backup script with selective file types only

i am looking for a backup script to be run in ssh which can move all *.php files only to a archive

Eg. a folder has 5 sub folders with different file types, which can be mix of PDF, jpeg, gif etc etc.
but the archive generated should only include the *.php files without breaking the directory structure.

So once I upload the archive again after modification and extract, only php files of the folders within get replaced without breaking the path from which they were archived from.

I tried to grab all php files using FTP by setting up the filter but doesn't seem to work correctly.

Try either:

find | grep \.php$
find ./ -name *.php

PS: If you want more, provide more (effort/script).

hth

that would list it, but what I wanted to do is
create *.Tar backup of only specific file types

like a
jpeg.tar tarball should have files with only jpeg.tar
php.tar would have only *.php included and would skip other files.

Check the -T option on the tar command.