Re: PHP 4 OOP, re-using a object?
| From: | Micky Hulse | Date: | Mon, 11 Sep 2006 03:38:22 +0000 |
| Subject: | Re: PHP 4 OOP, re-using a object? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241571@lists.php.net to get a copy of this message | ||
Christopher Weldon wrote:
What's the error, and how do you have the class and functions defined?Hi Christopher, thanks for asking. :) Actually, it was one of those silly, right in front of my face, logic errors... class RandomSplash { var $alphabet = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'); function randomize($what) { switch($what) { case 'css': $data = $this->$alphabet; ... ... ... } } See the error? $data = $this->$alphabet; should've been: $data = $this->alphabet; At first I thought it was how I was calling the class... all works now though. :) Thanks for asking. Let me know if you see a better way to do the above though, I am pretty new to using classes, but I am pretty handy when it comes to functions. :D Thanks, Cheers, Micky -- Wishlist: <http://snipurl.com/vrs9> Switch: <http://browsehappy.com/> BCC?: <http://snipurl.com/w6f8> My: <http://del.icio.us/mhulse>