You may have noticed that scripts which take a long time to execute often display nothing but a blank “loading” page in the web browser until they finish running. If you find yourself in this situation with a script you’ve … Continue reading
Monthly Archives: July 2005
Are you struggling with “date math?” If you’ve fallen into the trap of converting string-based timestamps into month, day, year, hour, minute, and second, and then trying to perform some sort of math or calculations based upon these values, consider … Continue reading
For months he had been her devoted admirer. Now, at long last, he had collected up sufficient courage to ask her the most momentous of all questions: “There are quite a lot of advantages to being a bachelor,” he began, … Continue reading
If you have a need for a unique string, consider using PHP’s built in uniqid() function. uniqid() will return a string value based upon the current system time, comprised of both letters and numbers, such as “3e5f173a6d6ed.” This can be … Continue reading
“Everyone has feelings, except for snakes and principals.” – Donna Maria G, age 9 “Laugh and the world laughs with you, cry and the world laughs at you.” – Rob P, age 8 “If life gives you nothing but lemons, … Continue reading
Before using the rand() function, it’s a good idea to seed the random number generator first. This can be done with the srand() function. Its most common form is: srand((double)microtime() * 1000000); If you don’t take this step before using … Continue reading
A woman was taking her time browsing through everything at a friend’s yard sale, and said to her, “My husband is going to be very angry I stopped at a yard sale.” “I’m sure he’ll understand when you tell him … Continue reading
If you want to read the contents of a file into a variable, it is not necessary to use the fopen(), fread(), and fclose() commands. Instead, take advantage of PHP’s file() command, which will read a file into an array … Continue reading
My husband and I took our two-year-old daughter to the home-improvement store. Madison got tired of walking, so my husband let her ride on his shoulders. As he walked, Madison began pulling his hair. Although he asked her to stop … Continue reading
When writing a MySQL query, it is not necessary to use escaped double quotes (“) when representing literal strings within the query. Single quotes (apostrophes) will work fine. For example, the following two lines of code will perform the same … Continue reading