Forums

Regarding Arrays - when it's not a number

designsedge 03 Jun, 2015
Answer
So, I have a problem that I can't get my head around. I am using the array function (PHP) based on your colors guide.
When I am using numbers 1=green, 2=blue, etc. it works - brilliantly, the output is the human readable response.

The problem I have is that my next drop-down-select is a file. filename.mp3 = Formal File Name. When I try the same code using the names, it still displays filename.mp3.

The code inside the array looks like this:
overload.mp3 => 'Overload',
I have triple checked the variables and code and they are identical, what am I doing wrong?

Again, thanks so much for a great product, it is helping my foray into coding and a great way to learn!
Mike

PS - this is the guide I am using
GreyHead 03 Jun, 2015
1 Likes
Hi Mike,

In PHP strings need to be quoted, integers don't. Please try
'overload.mp3' => 'Overload',

Bob
designsedge 03 Jun, 2015
Bob -

Perfection, figured it was something like that, but afraid to use a ' or a , or a ; (afraid PHP would catch the server on fire!)

Thanks so much!
This topic is locked and no more replies can be posted.