Welcome to WebmasterWorld Guest from 23.20.8.182

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

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)

Preferred Member

10+ Year Member

joined:Aug 20, 2004
posts:615
votes: 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.

Neophyte

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

New User

10+ Year Member

joined:Aug 10, 2004
posts:24
votes: 0

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

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


and 4
[webmasterworld.com...]
1:12 am on May 18, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 20, 2004
posts:615
votes: 0


Cool. Thanks!
6:15 am on May 18, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 29, 2005
posts:169
votes: 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 :)