Question: i have an array with this structure

```
$font = Array
(
["family"] => ABeeZee
["category"] => sans-serif
["variants"] => Array
    (
        [0] => regular
        [1] => italic
    )

["subsets"] => Array
    (
        [0] => latin
    )

)

```

i want to get the elements like **$family = ABeeZee**
**,$variants = regular, italic**

Answer: 
The problem is that you are checking for the class `iPhone5c` instead of the class `iphone5c`, note the capital P. JQuery is case sensitive, so you should writte them in with the same caps.

So your your code is storing 0 on the variables because it doesn't pass the `if else` condition. 

Furthermore, as other answers say, due to the scope, variables don't need to be redeclared using `var` inside the `if`. You should remove that.
I'm sorry guys i made a silly error, @nnnnnn pointed me in the right direction. i was not consistent in my cases, 'iPhone5c' uppercase P was in my jQuery code while 'iphone5c' lowercase p was in my html. I corrected the cases and it works fine now. Also you guys were also correct, I didnt need to have 'var' infront of each veriable in the if and else if cases. Thanks for helping! and thanks @nnnnnn for finding the solution :)