Related Content
Recreating Spotify Wrapped In PHP
I quite like the end of the year report from Spotify that they call "Wrapped". This is a little application in which they tell you what your favorite artist was and what sort of genres you listened to the most during the year.
Should A Constructor Throw An Exception?
Let's say you had a class that you wanted to use, but there was some sort of error in creating the object. This might be that the wrong parameters were passed, or the third party service (eg. a database) wasn't available at the time of creation.
Creating An Authentication System With PHP and MariaDB
Using frameworks to handle the authentication of your PHP application is perfectly fine to do, and normally encouraged. They abstract away all of the complexity of managing users and sessions that need to work in order to allow your application to function.
Creating Sparklines In PHP
A sparkline is a very small line graph that is intended to convey some simple information, usually in terms of a numeric value over time. They tend to lack axes or other labels and are added to information readouts in order to expand on numbers in order to give them more context.
PHP:CSI - Improving Bad PHP Logging Code
I read The Daily WTF every now and then and one story about bad logging code in PHP stood out to me. The post looked at some PHP code that was created to log a string to a file, but would have progressively slowed down the application every time a log was generated.
Generating Histogram Colour Analysis Graphs From Images In PHP
If you've ever looked at the settings in a digital camera, or have experience with image processing programs like GIMP, then you may have seen a colour histogram. This is a simple graph that shows the amount of different shades of colour are present in the image.
Comments
I am trying to round $705,666.66 to the nearest whole thousand. Is $706,000 correct?
Submitted by Anonymous on Mon, 06/27/2011 - 00:30
Permalinkthank you soo much for the.. it was a great help. :) :) :)
Submitted by Anonymous on Sat, 02/11/2012 - 05:47
Permalink#Function to get original amount after percent increase or decrease function getOriginalAmountAfterPercentChange($currentNum, $percentChange){ $number = ($currentNum / ($percentChange + 1) * 100); #Get current number $precision = ((strlen((int)$number) -3) * -1); #Figure out what precision to round to return round($number, $precision); }
Submitted by Juan Sanchez on Fri, 07/13/2012 - 19:21
PermalinkSubmitted by philipnorton42 on Fri, 07/13/2012 - 22:20
PermalinkAdd new comment