WordPress Iteration in Your Own PHP Application

Wordpress has its own way to loop the posts, that is different than what other CMS does. I think it’s great because of flexibility and usability reason. It would seem easy later, when you want to manipulate the result before it is displayed to the browser. So you want to implement the WordPress-style loop in [...]

PHP: Keep HTML Tags Paired

After applying substr to a string that contains HTML tags, usually I found that the result is broken because the closing tags are truncated. To prevent this, I have made a function that keep the closing tags remains and will not break the appearance of my website. Here is the function: Usage/Example: Feedback and comment [...]

How to fix ‘Function eregi() is deprecated’ in PHP 5.3.0?

I used to use eregi for validating email address input that matches to the regular expression. That would return true if given email address is matches to username@domain.ext pattern. Unfortunately, after upgrading PHP to the earlier version (5.3.0), it wont work properly. This is because eregi is one of several functions that are deprecated in [...]