Can I get an example please?
Posted
by Doug
on Stack Overflow
See other posts from Stack Overflow
or by Doug
Published on 2010-05-18T01:09:41Z
Indexed on
2010/05/18
1:30 UTC
Read the original article
Hit count: 359
$starcraft = array(
"drone" => array( "cost" => "6_0-",
"gas" => "192",
"minerals" => "33",
"attack" => "123",
)
"zealot" => array( "cost" => "5_0-",
"gas" => "112",
"minerals" => "21",
"attack" => "321",
)
)
I'm playing with oop and I want to display the information in this array using a class, but I don't know how to construct the class to display it.
This is what I have so far, and I don't know where to go from here. Am I supposed to use setters and getters?
class gamesInfo($game) {
$unitname;
$cost;
$gas;
$minerals;
$attack;
}
© Stack Overflow or respective owner