Regex Syntax – Frequently Used

The following is common Regex Syntax that frequently is used when Writing a Redirect. ^ – Match only if the following is at the beginning of the line $ – Match only if the previous is at the end of the line ? – Match the previous 0 or 1 times (makes it optional) . –...

Stylesheet Caching

This little snippet of code allows for you to update the stylesheet url based on the time it was edited so when you update the stylesheet the url changes and the cached version is no longer the correct version. <link rel=”stylesheet”...

Unwanted Characters in XML handling in php

So I ran into an issue where there was unwanted characters where spaces where suppose to be or nothing at all.  Here is a sample of those characters.  †“ Here is the fix that I implemented and it cleaned up the code right away. echo “<META...

Whois Query PHP Function

function whois_query($domain) { // fix the domain name: $domain = strtolower(trim($domain)); $domain = preg_replace(‘/^http:\/\//i', ”, $domain); $domain = preg_replace(‘/^www\./i', ”, $domain); $domain = explode(‘/', $domain); $domain =...

WordPress Plugin Starter Comments

Here is the minimum comment that you need for a plugin to be recognized. <?php /* Plugin Name: Example Plugin */   Here is the a sample of a plugin with more of the information that is recommended along with some of the default activation calls. <?php //...