For example i have folder "admin" which contains folder "1" and two php files "index.php" and "page.php". I try to use
tar -zcvf admin.tar.gz admin
You can use the
tar -C admin -zcvf admin.tar.gz .
-C, --directory=DIR Change to DIR before performing any operations. This option is order-sensitive, i.e. it affects all options that follow.