PHP

Serialize Detection Function
0

Serialize Detection Function

Thursday, April 1st, 2010

This function is especially handy for when you’re pulling data from a database and are unsure weather it has been serialized or not.

CONTINUE READING
Dynamic PHP Function Arguments
0

Dynamic PHP Function Arguments

Thursday, October 8th, 2009

PHP functions are great methods for optimizing your site. The real power of PHP comes from its functions.There are more than 700 built-in functions, and endless ones that you can make yourself. But a good think to know about is arguments. And more specifically dynamic arguments. Sometimes, depending on a function, the number of arguments [...]

CONTINUE READING
Alternate Automatic Include File
0

Alternate Automatic Include File

Friday, September 11th, 2009

A week ago I wrote a post on how to easily, and automatically include files on your website using the Apache module php.modc. Unfortunately, not all we3b hosting providers have this module switched on, and don’t allow you to change this. Luckily there is a workaround involving the RewriteEngine. The idea is simple: redirect all [...]

CONTINUE READING
Automatically Include Files with PHP & Apache
0

Automatically Include Files with PHP & Apache

Wednesday, September 2nd, 2009

Need to include a files in all of your site’s pages? Normally, you’d use require() or include(). But do you really want to manually past the include code in every page? There’s the little known PHP directive auto_prepend_file and auto_append_file. What are PHP directives? They’re essential global PHP settings that are defined in you php.ini [...]

CONTINUE READING
WordPress Descendant of Category
3

WordPress Descendant of Category

Friday, July 17th, 2009

WordPress’s default category structure is nice, but it lacks one major function: descendant category detection. The normal WordPress function in_category() only returns true if the current post is in the specified category, not if it’s a descendant. This can be especially frustrating when creating different templates for different categories. You don’t want to have to [...]

CONTINUE READING
PHP Ternary Operator
0

PHP Ternary Operator

Wednesday, July 1st, 2009

Codes can get long, so any kind of shortcut is always welcomed. Enter: The Ternary Operator. If/Else conditional statements can take up a lot of space. Especially, if you’re like me and like everything to be formatted with plenty of line breaks. Unfortunately, despite being easier to read, all that long winded coding adds to [...]

CONTINUE READING