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
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
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
Hush-A-Bye Buddy In our guest room It’s been three weeks now — Are you leaving us soon? We’ll all miss your snoring And carrying on, But please– Won’t you go back To Boca Raton?
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
A couple was arranging for their wedding, and asked the bakery to inscribe the wedding cake with “1 John 4:18” which reads “There is no fear in love, but perfect love casts out fear.” The bakery evidently lost, smudged or … Continue reading
I have my own system for labeling homemade freezer meals. Forget calling them “Veal Parmigiana” or “Turkey Loaf” or “Beef Pot Pie.” If you look in my freezer you’ll see “Whatever,” “Anything,” “I Don’t Know,” and, my favorite, “Food.” That … Continue reading
A guy was on the side of the road hitchhiking on a very dark night and in the middle of a storm. The night was rolling on and no car went by. The storm was so strong he could hardly … Continue reading