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

Tag PHP

PHP: Get the first Key of an Associative Array

I am not completely sure about it, but I somehow don’t think that I’ve ever needed to get the first key of an associative array using PHP before. Sure, a simple problem with a simple solution, but seeing as I… Continue Reading →

PHP: “JPEG library reports unrecoverable error: Not a JPEG file: starts with 0x89 0x50” Error Solved

My cross-platform Kinetica TouchandTell app running on an old iPad 3 was not successfully uploading images to our new RedStation hosted Ubuntu server (the Android builds were doing it just fine), and I wasn’t really sure why. The Appcelerator Titanium… Continue Reading →

Ubuntu Server: How To Enable OPcache for PHP 7 on Apache

PHP is what is known as an interpreted coding language, meaning that unlike compiled apps that have already been compiled down into bytecode (i.e. you have to compile your application first so that the OS can run it), PHP scripts… Continue Reading →

FPDF: How to use a Degree Symbol in a Generated PDF

I’ve been using the FPDF PDF generator library for years now as the de facto method for my PHP projects to produce PDF reports. However, one minor annoyance is that the generated PDF files often falter when it comes to the… Continue Reading →

PHP: Figure out which Function called Your Function

When troubleshooting code, it is often quite handy to know what function called the function that you are busy working your way through. To do this you need a backtrace, and PHP makes getting one pretty easy thanks to its… Continue Reading →

Solved: F3 Framework Route is running Twice

I’ve inherited a project written using the Fat-Free Framework (or F3 Framework), which is billed as being a lightweight PHP micro-framework that is intended to be easy-to-use and fast, with a gentle learning curve thrown in for good measure. (In… Continue Reading →

PHPMailer: AddReplyTo not working/being ignored

PHPMailer is a popular full-featured email creation and transfer class for PHP, and one that I most often use in my projects. We recently spotted an issue whereby we were setting the AddReplyTo field to a mail object for send… Continue Reading →

Error: Call to undefined function mcrypt_get_iv_size()

I installed my web application onto a new version of Ubuntu Server, and noted almost immediately that the web application crashed on each login attempt. Consulting the Apache error log, the issue quickly became clear: It would seem that php_mcrypt.dll… Continue Reading →

PHP: How to Convert a Date/Time from UTC to another Time Zone

Having previously shown you a useful way of quickly converting a timestamp into a formatted date string, here’s a quick way of actually getting a date/time in a time zone that you actually want – and again we turn to… Continue Reading →

« Older posts

© 2021 An Exploring South African — Powered by WordPress