MIKESTOWE.COM

you are here

PHP

smrtClass

smrtClass is a restrictive data type class based on PHP’s stdClass. Instead of allowing the free creation and setting of properties as the stdClass does, smrtClass requires properties to be setup first with a specific type or regex requirement. Data is then checked against this requirement when the property is modified, and if inconsistent with […]

Weekly PHP Test

What does the following code produce in PHP 5.0+

Weekly PHP Test

In PHP empty(array()) returns true, where-as empty(array(1)) returns false. What does the following code produce in PHP 5.0+

Weekly PHP Test

Assuming $cache->load($key) contains a cache of “yes” and $mediaCacheEnabled = true, what will the var_dump of $data return in this case?

Helpful Regex Patterns

Valid URI (prefix optional): http:// (or ftp/ https) prefix is optional in this regex ^((ftp|https?):\/\/)?([a-z0-9])([a-z0-9\.:\-]+)*[^:]?(@[a-z0-9][a-z0-9\.\-]*)?[^\[email protected]:]?(\.[a-z]{2,6})+([\/\?][[email protected]#&%+=\-_\.,:;%!\[\]~]*)*$   Valid URI (prefix required): http:// (or ftp/ https) prefix is required in this regex ^(ftp|https?):\/\/([a-z0-9])([a-z0-9\.:\-]+)*[^:]?(@[a-z0-9][a-z0-9\.\-]*)?[^\[email protected]:]?(\.[a-z]{2,6})+([\/\?][[email protected]#&%+=\-_\.,:;%!\[\]~]*)*$   Valid Email: ^([a-z0-9\.\-]+)+(@[a-z0-9][a-z0-9\.\-]*)(\.[a-z]{2,6})+$

Helpful PHP Resources

This is a collection of resources I have found to be helpful… and by placing them here I can find them again– plus I thought it might be helpful for others as well 😀 Best Practices Yahoo’s Rules for High Performance Websites Doctrine Basic Doctrine Query Doctrine Query Operations Doctrine_Record Class PHPUnit Testing YouTube – […]

Trackable Social Share Icons (Google Analytics)

What is Trackable Social Share Icons The Trackable Social Share Icons plugin enables blog readers to easily share posts via social media networks, including Facebook and Twitter. All share clicks are automatically tracked in your Google Analytics account. Trackable Social Share Icons Demo Scroll down to the first set of Social Sharing Icons (not the […]

Easy Google Analytics

What is Easy Google Analytics Easy Google Analytics is a simple WordPress plugin to allow you to add the latest version of Google Analytics to your site quickly and easily. Simply install the plugin, enter your Google Analytics ID in the admin, and you’re all set. Installing Easy Google Analytics Easy Google Analytics can be […]

PHP Malicious Code Scanner

OS Commerce, WordPress, Joomla, Drupal, and custom built sites have all been hacked by the “wonderful” <?php @eval(base64_decode($_GET[q])); ?> hack.  By slyly uploading a single php file to your server, these hackers gain the ability to push any code, view any source, and retrieve any data.  And unfortunately, as hard as we try to prevent […]

Simple Way to Get Page Rendering Time

Here is a super simple way to get the time it takes to render the page (well, almost). To start, you simply include the class, and then initiate it as a new object attached to a variable. Voila that’s it. The only thing you have to make sure of is that you do not unset […]

Previous Posts Next posts