Jump to content

Array index by its value (key)


smus

Recommended Posts

How to get an array index by its value (key)? Is there a special function for that in PHP?

For example, I have an array $a ["zero","one","two"] and a variable $b = "two", I know the value is in the array, but I don't know its index.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...