Archive | PHP

PHP: Using Switch to test Multiple Conditions

Ok, so maybe this is common knowledge, but I still felt a little clever when I figured out this trick.  The situation was that I wanted to test a bunch of different conditions to figure out which time category a date falls into.  It would be fairly simple to do with a bunch of if…then…else’s, […]

Continue Reading

PHP: Proper Case Function for PHP Strings

Yes, PHP does have a proper case function for strings: ucwords($string) If you’re looking for the lower and upper case string functions…here you go: strtolower($string); strtoupper($string); Why not a strtoproper(), just to keep it consistent? Well, consistency here wouldn’t exactly be consistent for PHP, would it 😉 ?

Continue Reading

PHP: What is the & Ampersand Preceding Variables

Well, this one is hard to find on Google, so I’m putting it in WhyPad to make it easy to find…at least for me, and I guess for you too since you here. Welcome! You may see PHP code snippets (PHP 5+ only) that have an ampersand, ‘&’, preceding a variable like &$my_variable. So, what […]

Continue Reading
ci_flame

Codeigniter: ActiveRecord Join Tip

I ran into a problem with a SQL JOIN in Codeigniter’s ActiveRecord class. This post will help you get past that, but first a little intro to frameworks. If you’re a PHP developer, you have probably considered one of the incredibly useful frameworks that are available today. Cake, Zend, Symfony, and Codeigniter are some of […]

Continue Reading

Powered by WordPress. Designed by Woo Themes