Tag Archives: PHP

Howto: Create and Stream a CSV with PHP

I find myself constantly creating csv files for users to download. Whether it’s a method for users to export their data to excel, a way for users to backup their hosted data, or just a simple way to send them … Continue reading

Posted in PHP | Tagged , , | 8 Comments

WordPress 2.5 Shortcodes

Warning: Shortcodes are affected by Trac ticket 6444, which was fixed in WordPress 2.5.1. First I touched on the topic in my first impressions of WordPress 2.5. Then I whined a little about the tickets relating to them, and eventually … Continue reading

Posted in Wordpress, WordPress Shortcodes | Tagged , , , | 62 Comments

WordPress Should Update get_sidebar to Work With Multiple Sidebars

I submitted an enhancement to wordpress yesterday, to allow get_sidebar to work with multiple sidebars. It’s an extremely simple fix, and you end up with a function that looks like this: By adding two lines and one optional parameter to … Continue reading

Posted in Wordpress | Tagged , | 10 Comments

PHP function to Redirect a user with a message

One of the common things that you need to do in PHP is redirect a user, and display a message on whatever page you are sending them to. There are a lot of reasons for this, but the most common … Continue reading

Posted in PHP | Tagged , | 14 Comments

Replace every other occurrence with str_replace

Well, someone put some code onto the str_replace PHP manual page to replace every other occurrence of a string with another string. However, it didn’t work, and was simply spam to get a link onto the PHP manual page (shame … Continue reading

Posted in PHP | Tagged | 3 Comments

PHP Pagination with mysqli

I’m asked pretty regularly for help with pagination in PHP. I have a nice mysqli pagination class that I use. Once it’s implemented, it is used like this:

Posted in PHP | Tagged , , | 15 Comments