## Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

### Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

# Basic Array and If statement problem.

Hey there! I am trying to do the following:

1) generate a random number. 2) Compare that number with the number under the ‘card value’ key in the array. 3) If the number is in the array add it to the total variable and remove that whole array from the multi-dimensional array.

I am very new to programming and have the following:

```\$cards[] = array('card_value' => 1,
'card_suit' => 'Heart',
'card_face' => 'Ace');

\$cards[] = array('card_value' => 2,
'card_suit' => 'Heart',
'card_face' => '');

\$cards[] = array('card_value' => 3,
'card_suit' => 'Heart',
'card_face' => '');

\$cards[] = array('card_value' => 4,
'card_suit' => 'Heart',
'card_face' => 'Ace');

\$cards[] = array('card_value' => 5,
'card_suit' => 'Heart',
'card_face' => '');

\$cards[] = array('card_value' => 6,
'card_suit' => 'Heart',
'card_face' => '');

\$cards[] = array('card_value' => 11,
'card_suit' => 'Heart',
'card_face' => 'Jack');

\$cards[] = array('card_value' => 12,
'card_suit' => 'Heart',
'card_face' => 'Queen');

\$cards[] = array('card_value' => 13,
'card_suit' => 'Heart',
'card_face' => 'King');

\$total_number = 0;

do {
\$randon_number = rand(1,13);
if (\$random_number == \$cards('card_value')){
echo \$cards('cards value');
\$total_number = \$total_number + \$randon_number;
}
else {
echo 'not matching value';
}
}
while
(\$total_number <= 21);
```

i keep getting the error Function name must be a string. Can anyone help? Thankyou