Like dan said, you can fully do it if my_array is a global variable, or you have some other means of the function being able to access the variable scope where that array lives.
[fphp]array_search[/fphp] finds the key for a given value in an array, but you must pass the original array as an argument.
Arguments passed to functions lose their labels in the scope outside the function, there is no way to find out what a variable was called when it was sent to the function - as indeed it may not even be a variable - it could be a constant