MemphiS Posted November 1, 2008 Share Posted November 1, 2008 Doesnt seem to be workin for me at all :s <?php class cards { function cards(){} var $deck = array("2-H","3-H"); //.. And so on up to 52 cards } $start = 1; if ($start == 1) { $a = new cards(); $array = array ("$a->deck[0]","$a->deck[1]"); print_r($array); Just Gives out Array ( [0] => Array[0] [1] => Array[1] ) and so on so im not really to sure how to solve this Thanks for your help } Link to comment https://forums.phpfreaks.com/topic/130969-solved-setting-data-from-a-class-into-an-array/ Share on other sites More sharing options...
JasonLewis Posted November 1, 2008 Share Posted November 1, 2008 Remove the quotes around the variables inside the array (the array above print_r()). Link to comment https://forums.phpfreaks.com/topic/130969-solved-setting-data-from-a-class-into-an-array/#findComment-679886 Share on other sites More sharing options...
MemphiS Posted November 1, 2008 Author Share Posted November 1, 2008 Thanks Projectfear =) haha gotta laught when i turns out to be something as small as that =p Link to comment https://forums.phpfreaks.com/topic/130969-solved-setting-data-from-a-class-into-an-array/#findComment-679888 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.