newbie $this question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
idias
Forum Newbie
Posts: 1
Joined: Fri Mar 18, 2011 10:20 am

newbie $this question

Post by idias »

Hi, I am reading an article to create a memory game, and I am stuck with a very simple part (I am not that strong in php). What does the $this->css[] refers to? I usually use it inside a class only and use it to refer the current instance of a object. In this case though, I don't what it means and what it's referring to. Is it like referring to the cards array?

The link is of the article is http://www.webdevplayground.com/2009/09 ... y-and-php/

$cards = array();
for ( $i = 0; $i < $num_of_cards; ++$i ){
$cards[$i] = new Card($card_files[$i]);
$this->css[] = $cards[$i]->get_css_block();
}

Thanks in advance
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: newbie $this question

Post by yacahuma »

you have to download the full example. Is just an array

Code: Select all

class Board
	{
		private $css = array();
}
Post Reply