| ||||||
Read our latest entries.
Posted by Garren Harland on September 7, 2009, 11:41 am.
If you are writing a PHP application that is dealing with data related to weather conditions you will no doubt at some point have to convert between Celsius and Fahrenheit. To perform these conversions two simple formulas are required. Click here to read on.
Posted by Garren Harland on September 7, 2009, 10:52 am.
England has never been a country willing to fit in. Never has there been any interest in driving on the right hand side of the road, and when asked how many kilograms are found within a Stone, the reply will often be along the lines of. Click here to read on.
Posted by Garren Harland on August 31, 2009, 11:36 am.
The following tutorial discusses how the metric unit meters can be converted into yards and feet with the help of PHP. Naturally enough these same conversion numbers can be used to perform the conversion in other programming languages. Click here to read on.
Posted by Garren Harland on August 31, 2009, 10:37 am.
This tutorial will discuss how Kilograms (KG) can be converted into stones or Pounds with PHP. Especially the stones are easy to calculate from KG, once the number of pounds has been established. For the sake of accuracy this in-between step can be seen as a necessary one. Click here to read on.
Posted by Garren Harland on August 5, 2009, 2:54 pm.
If you are looking for the value of a specific percentage of a number in PHP all you need is some basic maths. For instance, if you want to find out 5% of 100, simply multiply 100 times .05. Here are a few examples to try out. Click here to read on.
Posted by Garren Harland on August 5, 2009, 2:33 pm.
Here is a useful bit of code for testing whether or not a number is dividable by a specified value. In our example below we will go through a "for" loop, checking every number to see if it can be divided by 5. If yes we will print it, if not we shall skip it and go on to the next. Click here to read on.
Posted by Garren Harland on August 3, 2009, 3:13 pm.
Sometimes all you need from a string are certain elements. Such an element can be a hidden number which has significance to you. Maybe a timestamp for instance. Click here to read on.
Posted by Garren Harland on August 3, 2009, 11:17 am.
When working with divisions the remainder is often required. This is often important for subsequent calculations, such as the conversion from seconds into days, minutes and hours. Click here to read on.
Posted by Garren Harland on July 21, 2009, 5:17 pm.
Previously I have discussed how additions, subtractions, multiplications and divisions can be performed using bc functions with the results being produced to a specified decimal point. Click here to read on.
Posted by Garren Harland on July 21, 2009, 4:57 pm.
Here are four PHP maths functions that might come in handy. If for instance you have to perform a simple addition, subtraction, division or multiplication, and want the result to be rounded to a specific decimal point, here is how you can do it. Click here to read on.
Posted by Garren Harland on July 13, 2009, 11:17 pm.
In order to convert negative numbers into positives in PHP one simple function is required: abs(). The abbreviation abs stands for absolute values, and works like this. Click here to read on.
Posted by Garren Harland on July 13, 2009, 11:00 pm.
Here is a function that could come in handy with numbers games. More specifically: numbers games where the winner is the person who has guessed the closest number to an end result. Click here to read on.
Posted by Garren Harland on July 13, 2009, 1:00 pm.
This tutorial will teach you on the one hand how to convert decimal numbers into hexadecimals codes and vise versa, while at the same time having a closer look at the format of HTML Color codes. Click here to read on.
Posted by Garren Harland on July 13, 2009, 10:42 am.
Here is the predefined PHP function that can calculate your square routs. Click here to read on.
Posted by Garren Harland on July 11, 2009, 8:50 pm.
The function asin() can be used to calculate the Sinus Arch in PHP. Simply insert the value in between the brackets and let PHP take care of the rest for you. Click here to read on.
Posted by Garren Harland on July 11, 2009, 6:58 pm.
As with most mathematical requirements PHP already has a function in place to help deliver your results. And even for Cosine Arch calculations PHP is not a let down. Click here to read on.
Posted by Garren Harland on July 11, 2009, 6:15 pm.
PHP has the constants mentioned in the title and others already predefined. All you need is the right code to access them by! Click here to read on.
Posted by Garren Harland on July 4, 2009, 9:47 pm.
If you are like me you probably once upon a time spotted that PHP had a random number generating function called rand(), decided to save it to your memory, and left it at that. After all, a random number is a random number. Why would a programming language need more than one random number generating function? Click here to read on.
Posted by Garren Harland on July 4, 2009, 8:57 pm.
Producing pi in PHP is even simpler than printing Hello World. Click here to read on.
Posted by Garren Harland on July 4, 2009, 8:42 pm.
Previously I have written about the PHP function bindec(), and how it can convert a binary code into a decimal number. By reversing the function the opposite can be done, so changing bindec() into decbin() allows us to convert decimal numbers into binary code. Click here to read on.
Posted by Garren Harland on July 4, 2009, 8:16 pm.
With the function bindec() you can translate a binary number into a decimal. Not that the largest convertible number (saved as a string) consists of 31 ones. This number equals the decimal value of 2147483647. Click here to read on.
Posted by Garren Harland on July 4, 2009, 5:10 pm.
Looking for a PHP function to give you the greatest Common Divisor of two numbers? Then look no further. Although PHP does not as of yet provide such a function itself in its array of maths functions you can write a Greatest Common Divisor function yourself. Click here to read on.
Posted by Garren Harland on July 4, 2009, 1:13 pm.
Are you in need of a PHP function that rounds numbers up to the closest integer? Then the function ceil() is your solution! Just insert the number that you need rounding up in between the brackets. Click here to read on.
Posted by Garren Harland on July 3, 2009, 8:50 pm.
Do you need a PHP function to round down numbers down to the closest integer? Then floor() is the function you are looking for! To utilise the function insert the number that you need rounding down in between the brackets. Click here to read on. |