Re: PHP 4 OOP, re-using a object?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>	

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux