Things to do in Cape Town, the Helderberg, and the Cape Winelands

Tag extract

Ubuntu Server: How to Extract a .tar.gz Archive File

An old one, but for my own reference purposes, worth noting down here in these pages. In order to extract the contents of a .tar.qz archive file, turn to the tar command (“man tar” for options as per usual): In… Continue Reading →

PHP Function to Extract an E-mail from a String

Given a string, it would often be quite useful to extract any e-mail addresses that it might contain. Luckily for us, PHP makes this fairly trivial through the use of its powerful filter_var functionality. Essentially the plan of attack is… Continue Reading →

PHP: Extract a Zip File’s Contents

The other day I needed to automate the unzipping and processing of files contained within a zip archive. Using the existing PHP Zip library and some help off the web, this is what I was left with:

PHP Code to Extract Attachments from Mail Files

For a recent project I needed to parse .mai mail files to locate excel and zip files that may have been sent through as attachments. The following block of code is the result of my work:

© 2021 An Exploring South African — Powered by WordPress