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.
PHP Question: Variable Reference
Question
What does the following code print out?
function arrayPrint($array)
{
echo implode(' ', $array);
}
$arrayA = [1, 2, 3];
$arrayB = $arrayA;
$arrayB[1] = 0;
arrayPrint($arrayA);
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.
Comments
Why you're getting
NaN
: When you asknew Date(...)
to handle an invalid string, it returns aDate
object which is set to an invalid date (new Date("29-02-2012").toString()
returns"Invalid date"
). CallinggetTime()
on a date object in this state returns.works perfectly thanks
Submitted by Ravi on Fri, 10/05/2018 - 07:30
PermalinkSweet! Thank you for the information!
Submitted by Nicephorus Denisov on Fri, 09/27/2019 - 08:53
PermalinkNіce! Thanks a lot for the guide!
Submitted by Joseph Carroll on Sun, 10/06/2019 - 04:55
PermalinkThanks :)
Submitted by rüzgar on Fri, 05/08/2020 - 12:57
Permalinkit helped me a lot, very thanks...
Submitted by Yilmaz on Fri, 01/08/2021 - 18:27
Permalinkvery nice blog
Submitted by A guy on Thu, 05/13/2021 - 16:27
PermalinkAdd new comment