I am trying to create a tar archive on my server through PHP as follows:
exec('tar -cvf myfile.tar tmp_folder/innerfolder/');
It works fine, but the saved file preserves the full path including tmp_folder/innerfolder/ I am creating those on the fly for users, so it's a bit unusable for users to have this path while extracting. I have reviewed this topic - How to strip path while archiving with TAR , but in the explanation the guy doesn't give an example, and I don't quite understand what to do.
Please, tell me with an example, how to add files to tar in a way that it does not preserve the 'tmp_folder/innerfolder/' part in archive?
Thanks in advance