WordPress Memory Allocation error while installing a plugin

Mar 16

Ever run into an error while installing a plugin and or attempting to activate it within your copy of wordpress. Your error may look something like Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 491520 bytes) in wp-content/plugins/nextgen-gallery/admin/manage-images.php on line 485 I recently recieved this error installing NextGEN...

Read More

PHP Debug Array or JSON object easily

Mar 08

As a engineer I work with Arrays of Data, day in and day out. Whether its building them out or pulling them in from somewhere. More often than I’d like to admit something gets lost in translation and I have to see whats going on. Now most people will just simply do a quick debug statement like: echo "<pre>"; print_r($arrayData); ...

Read More

PHP Calculate Distance between 2 Longitude / Latitude Points

Mar 08

Geo-location is becoming more and more popular as time passes and technology supports it better more so as there is plenty of free resources to help you get the data you need to be more GEO centric with your users. However sometimes you want to give a range from point A to point B and this is one way you can do it. You can do the calculation in this function to...

Read More

PHP Validate Email Address

Mar 08

If you have ever needed to validate an email address to see if the format is good then heres a nice function that does that and more up to and including checking the DNS of the domain of the email address to see if its actually a real domain. Though a lot of people will insist that a single one line regex with preg_match() will be more than enough to suffice most...

Read More

PHP Strong Password

Mar 08

If you want to prompt your users to create password that is a certain length more or less, that is also strong by today’s definition then here is a good example. This can be elaborated on even more but for common use in most practices this is more than enough. You can comment out like I have in the example below one or more if-else statements if you wish to not...

Read More

PHP Verify a Dollar Amount

Mar 08

Just a simple function to see if an input numeric value is actually a US Dollar (USD) format Example: Two Dollar Amounts provided to the script.. 1502.38 and 10O.00 Good: 1,502.38 Bad: 10O.00 came back false. function verifyMoney($what){ if (preg_match('#^[0-9]+(\.[0-9]{0,2})?$#', $what)){ $monkey = number_format($what,...

Read More