How to make an anniversary counter announcement script using ordinal numbers
Today being it is our 16th wedding anniversary I decided it would be appropriate to build a small script to keep track and post a message automatically on our special day together. I wanted this...
View ArticleHow to use preg_replace to replace phrase between question marks
<?php $string = “?This is a test that should be in single quotes quotes?”; $text = preg_replace(”/(\?([^\?]+)\?)/”,”‘\\2′”,$string); ?> regular expression produces: This is a test that should be...
View ArticleUsing floor and time to calculate number of days elapsed from UNIX timestamp
Finding out the number of days elapsed from a UNIX timestamp is actually pretty straightforward. If you only know two dates then first you’ll need to convert the date to a UNIX timestamps and then...
View ArticleUsing header to redirect the browser
The PHP header function allows redirection of the browser, among other cool things. Example redirecting the browser to php-scripts.com homepage: <?php header(”Location:...
View ArticleParsing names and numbers out of text
At one of our sites we needed to parse out some names and numbers from a log file. The strings also contained comment text and the order would be mixed format. These types of regular expression parsing...
View ArticleTurck MMCache and PHP encoder
I’m not sure how current or updated this is because I found some broken project links (all links below work) but these projects seem promising and worth closer inspection, especially if one is looking...
View ArticleQuery results within last X days
Sometimes it is necessary to query data from the last 7 days. Here’s how to create a dynamic query inside a script using PHP / MySQL to return a list of users who last visited within X number of days...
View ArticleAJAX MyTop
Man, how many clicks does it take to get the download these days at Sourceforge? Seems like it took me a half dozen to get to the AjaxMyTop project download. MyTop creator Jeremy Zawodny writes:...
View ArticleApache + PHP on Mac OS X
Though the screenshots have changed the basic process is the same, Kevin Hemenway, takes readers through how to setup an Apache server on Mac OS X and then how to turn on PHP 4. To edit the httpd.conf...
View ArticleOpen source phpMyEdit
phpMyEdit: generates PHP code for displaying/editing MySQL tables in HTML. All you need to do is to write a simple calling program (a utility to do this is included). It includes a huge set of table...
View Article