Article of the week

Longest Collatz sequence in PHP

Longest Collatz sequence in PHP

08 Feb 2020 23:30:22


The longest Collatz sequence for input less than N in PHP programming language.


Read full article »

Recent articles

Sorting UTF-8 strings in PHP

29 Apr 2017 16:41:28

Sorting UTF-8 strings in PHP

When trying to sort a list of strings in PHP, one needs a reliable way of comparing the strings first. PHP has some proven comparison functions, notably strcmp. Strcmp works fine for ASCII character set, in which the same number of bits, namely seven, is used to encode a symbol. ...

Read more »

Secondary database query and shortcodes in Wordpress

20 Apr 2017 11:14:15

Secondary database query and shortcodes in Wordpress

Secondary database queries are queries that you do in Wordpress once the main, URL-based query has been performed. Typically, these extra queries are used to fetch data like featured or category post and embed it on in a section of a template file. Alternatively, the data goes ...

Read more »

Quicksort algorithm implementation in PHP

13 Apr 2017 09:56:52

Quicksort algorithm implementation in PHP

Quicksort algorithm, as the name of it suggests, is yet another piece of code for sorting ( lists of ) items. The algorithm has been in use for nearly 60 years ( Anthony Hoare - its inventor - published it in 1961 ), and is still one of the fastest ways of sorting large lists ...

Read more »

Recursive bubble sort algorithm in PHP

06 Apr 2017 17:48:19

Recursive bubble sort algorithm in PHP

In this article I'm going to take a quick look at arranging elements of a list in a chosen order, or simply speaking - sorting, with a twist, though. Many algorithms have been devised for the purpose of sorting over the last sixty or so years. Arguably, one of the oldest ...

Read more »