JOEL LIPMAN Systems / Automation / AI

Knowledge base / Since 1999

Personal Home Page Tutorials & Guides

Practical Personal Home Page tutorials, troubleshooting notes and implementation guides from real projects.

Advanced search

21 entries / Personal Home Page

Clear filters
Php convert filesizes to bytes kb mb gb
Personal Home Page

Php convert filesizes to bytes kb mb gb

Just a quick note on how to format a given filesize and to reduce the display output to a small string, eg: 196 bytes : displays as => "196 bytes" 12945 bytes : displays as => "12 Kb" 1478515 bytes : displays as => "1 Mb" 8798745455 bytes : displays as => "8 Gb"

Read note 24,315 hits
Convert seconds to total time in PHP
Personal Home Page

Convert seconds to total time in PHP

This is intended for activity/session durations and although I usually get MySQL to do the date/time calculations, there are times when we have to do with PHP. This is the shortest way I know to properly convert seconds into total hours, minutes and seconds (taking into account regional settings and without using a dat...

Read note 15,404 hits
First and Last Entry on a Page using Modulus Remainder
Personal Home Page

First and Last Entry on a Page using Modulus Remainder

So I know it's quite a long title but I'm not sure what I'll be searching next time. It has taken me a lot longer than I thought it would mostly out of frustration and the inability to know exactly what I'm looking for... always difficult. After a cup of tea the solution was glaringly obvious, just do a primary school...

Read note 23,698 hits
PHP & MySQL Search Engine
Personal Home Page

PHP & MySQL Search Engine

Do you hate sites that do not have a search feature? I do. I think it defeats the purpose of cramming information endlessly in cyberspace. So we want to give a search engine to our users. This sounds really simple, we could try: $search_term_esc = AddSlashes($search_term); $sql = "SELECT * FROM Content WHERE content_bo...

Read note 56,686 hits
UTF8 Unicode PHP MySQL for International Characters
Personal Home Page

UTF8 Unicode PHP MySQL for International Characters

This is a note to myself but also to anyone out there who's spent as long as I did looking for a solution to this. Maybe it's just me but this is the scenario: Joomla works fine with international characters A Module Extension I wrote for Joomla! displayed funny characters. The Joomla! articles were displaying the corr...

Read note 36,558 hits
Yesterday's time in PHP
Personal Home Page

Yesterday's time in PHP

Quick tip or note to self: How to get yesterday's date irrespective of date format or daylight savings time. $today=date("Y-m-d"); $yesterday = date('Y-m-d', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y")));

Read note 9,315 hits
Creating a Top 10 chart with less code
Personal Home Page

Creating a Top 10 chart with less code

I've decided to put something in here as it took me an age to find out how I could do it. This is when using a MySQL query within a PHP script. The process is used often to do a statistics table or top ten chart of your data (eg. movies, music, etc). My aim is to do the following: retrieve data from a table, count the...

Read note 27,212 hits
Outputting PHP files into different file formats
Personal Home Page

Outputting PHP files into different file formats

I'm beginning a list as I've just spent an age trying to get PHP output to create a text file. Then my client showed me how she then opens the text file in Excel, so I said we could get the script to do that instead.PHP to TXT header('Content-Type: text/plain; charset=utf-8'); header('Content-Disposition: attachment; f...

Read note 14,222 hits

Working principle

Our Purpose

This site exists as a practical knowledge base built from real-world experience across systems, platforms, and technologies since 1999. Much of the content documents solutions, edge cases, and working patterns that were learned through investigation where documentation was incomplete or absent, and is shared to reduce the same friction for others.

27 Years in IT
1021 CRM clients
810 Site articles
29.7m+ Reads / hits

Knowledge base

Search notes

Find matching words in article titles and content.