You created your own movie in iMovie but you can't figure it out how to save the darn thing into a playable .mp4 file on your hard drive. I've been there, let me show you how to do that.
Often in PHP you want the same block of code to run over and over again and instead of adding several almost equal lines, you can use loops to perform this task much easier.