I’ve been wanting to share this tip for awhile. It’s going to be short though.
Ever wanted to make a file a little more secure by adding a password? It’s easy to do on a LINUX server. All it takes is one line of code:
shell_exec('zip -qjP password 'newZipFileName.zip' 'fileYouWantToZip.doc');
Easy cheesy! If you’re having trouble, both file names may need the directory path as well.
WARNING: This does NOT work on a Windows server. Windows requires you to go use a zip application in order to do this. I learned this the hard way!
That’s it for now! Told you this was going to be short and sweet!