Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- One line conversion table


ocon - 3:42 am on Dec 28, 2012 (gmt 0)


I have numbers representing strings that I would like to convert back into their strings.

Right now I am using:

$sense = array('', 'sight', 'hearing', 'touch', 'smell', 'taste');
echo $sense[$number]; // 3 => touch


I do not use the $sense array anywhere else and I have several one-time use arrays like this.

Is there some super awesome function that I can use to turn this into a one liner to help declutter my code? I do not need to use arrays if there is something more appropriate.


Thread source:: http://www.webmasterworld.com/php/4531611.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com