Article of the week

Recursive implementations of some Maths sequences and series in PHP

Recursive implementations of some Maths sequences and series in PHP

28 Jul 2017 17:54:44


Example implementations of some popular maths sequences and series in PHP programming language.


In this article I give a couple of PHP implementations of popular Maths sequences and series. Broadly, each piece of code given returns nth term of a sequence / series. Each of the implementations depends on linear recursion. Each of the functions a is a static methods of class ...

Read full article »

Recent articles

Traversing array from the middle in PHP

30 Aug 2017 15:51:20

Traversing array from the middle in PHP

Traversing an array starting from the middle item in it is in many ways similar to traversing it from the beginning or the end. One small catch is such that, the middle item, or to be more accurate, the middle index of the array, has to be found before the rest of job can be ...

Read more »

Square pyramidal numbers and implementing them in PHP

19 Aug 2017 14:24:59

Square pyramidal numbers and implementing them in PHP

Square pyramidal numbers and implementing them in PHP Imagine a couple of boxes standing on a table. In each of these boxes there is one or more balls. Boxes are sorted according to the number of balls they contain. When you look into these boxes, you notice, that in the first ...

Read more »

Comparing two arrays or objects with a function in PHP

17 Aug 2017 16:07:40

Comparing two arrays or objects with a function in PHP

In this article I look how to compare two arrays against one another in PHP. For the purpose, I provide a flexible PHP class, which allows for comparisons of both arrays and objects whose internal working is based on array. The class, I called it SWWWArrayCompare, carries out ...

Read more »

Formatting array of numbers recursively in PHP

12 Aug 2017 15:57:38

Formatting array of numbers recursively in PHP

If you have ever tried to obtain a formatted value in PHP, it is likely you did so with one of printf, sprintf of vsprintf functions. In general, these utilities accept a formatting string and one or more arguments. php.net has some good examples and descriptions on how they ...

Read more »