Hi, I'm having trouble figuring this out. I want my script to do two things:
Compare a value to values in an array.
If the declared value exists in the array, I would like to return it's associated key.
If it doesn't I want to simply return the value itelf.
EXAMPLE:
arrayexample = array (
'mike' => 'one',
'joe' => 'two',
'eva' => 'three'
);
If $value declared is 'joe', return 'two'
if $value declared is 'steph', return 'steph'
Can anyone help?
Thanks!