homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Bag-O-Tricks for PHP III
Couldn't find "part III" in the php library section

 2:41 pm on May 17, 2005 (gmt 0)

has Bag-O-Tricks for PHP II been named something else? I located, the first, second, and fourth sections, but couldn't located the third.

These bag-o-tricks threads have been a real resource to me - as I'm sure they are to others.




 2:44 pm on May 17, 2005 (gmt 0)

II: [webmasterworld.com...]
III: [webmasterworld.com...]


 4:03 pm on May 17, 2005 (gmt 0)

and 4


 1:12 am on May 18, 2005 (gmt 0)

Cool. Thanks!


 6:15 am on May 18, 2005 (gmt 0)

Well, all the topics were closed, but I wanted to make a comment. Guess I'll post it here! :)

In the first one, someone mentioned something about variable functions and their usefulness. I didn't feel like sorting through all the other posts to see what people had posted, but I have a really good use for them. A dynamic database class. Say your database class may need to connect to either a MSSQL server or a MySQL server. And, it's possible the server might be running PHP 5, so then you may need to utilize the MySQLi functions, instead. Simple enough, most of those three classes of functions are identical, with a few exceptions, of course. But, here's the example:

class database {
// yada yada
public $type = 'mysqli'; // default type

// more stuff

// example function
public query($sql, $link) {
$query = $this->type.'_query';
return $query($sql, $link);

Note that this is just an example. I have a single class that I use reguardless of the server type :)

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved