PHP

How to make WooCommerce update shipping costs on update_order_review

Been banging my head over this for a couple of days now and couldn’t find any answers until I actually […]

Gist: Single page image gallery generator in PHP

Made a single-page script to generate a gallery from pictures you have in a folder. It contains a small admin […]

PHP

Remove NULL values from PHP arrays

$new_array = array_filter($old_array, 'strlen');

PHP

How to strip russian characters from a string

$string = 'Этот текст на русском языке'; var_dump(preg_replace('/[\x{0410}-\x{042F}]+.*[\x{0410}-\x{042F}]+/iu', '', $string));

PHP

Securing your ajax scripts

Here’s a few tricks I’ve learnt while working on a project: 1.  Check HTTP_X_REQUESTED_WITH Referrals are tricky. They cannot be […]

Accessing a CodeIgniter controller via CLI for usage within cron jobs

There are two ways to access CodeIgniter controllers from the CLI. One is presented in the CodeIgniter documentation and it […]

PHP

Routing multiple subdomains using the same CodeIgniter installation

I’ve recently worked on an online portal with product listings for companies. The portal would allow paying customers to have […]

PHP

Ugly fix for empty subject in CodeIgniter batch e-mail sending

This has happened to me a lot when trying to send batch e-mails using CodeIgniter 2.x. The first e-mail sent […]