After the shell filename expansion, your tar command results in something like:
Code:
tar -ztvf 20120323/www-20120323.tar.gz 20120325/www-20120325.tar.gz 20120326/www-20120326.tar.gz
The name of the archive to test is that one highlighted in blue and given as argument of the -f option. The other names are arguments of the tar command and they are searched inside the previous archive. If you use -x instead of -t, this mechanism serves to extract only some files from a given archive.
If you want to look for a file inside multiple archives, better to use a loop, e.g.
Code:
for archive in */www-*.tar.gz
do
tar --wildcards -tvf $archive *.php
done
As you can see, the grep command is not necessary, since we want to look for php files inside the archive, hence we pass them as arguments. The --wildcars option is necessary to enable pattern matching with *. Hope this helps.