Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6975391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:21:43+00:00 2026-05-27T17:21:43+00:00

Taking a dictionary as an example, let’s say I’ve got the following array to

  • 0

Taking a dictionary as an example, let’s say I’ve got the following array to catalog the pronunciations of a given word:

$pronunciation["text"] = array("alpha", "beta", "gamma", "delta", "epsilon");

$pronunciation["definition"] = array(1, 2, NULL, NULL, 1);

text contains the pronunciation that will be displayed to the user, while definition contains the ID for the definition in the list where that pronunciation applies. If definition is NULL, it’s not associated with any particular definition, and should be displayed elsewhere in the entry.

Now, if I try to do something like the following:

$key = array_search(1, $pronunciation["definition"]);

All I’ll get is 0, since that’s the first key in definition that contains the value. Likewise, substituting NULL returns 3, however both of these actually have another related key that I’m trying to fetch.

Is there a way to get it to return all related keys without having to resort to brute force methods such as a for loop?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:21:44+00:00Added an answer on May 27, 2026 at 5:21 pm

    Try this one:

    array_keys($pronunciation["definition"],1)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a dict = {...} #lots of words in dictionary I
Say I have a very large dictionary / associative array and I want to
Taking this article on classes and structs as an example: http://msdn.microsoft.com/en-us/library/ms173109.aspx namespace ProgrammingGuide {
Taking the jQuery framework for example, if you run code like this: $(document).ready(function init()
If you have a method in objective c that builds an array or dictionary
Taking the GNU make application as an example, when I create a makefile it
Consider the following code: private Dictionary<RobotSettings, Trader> createTradersFor(IEnumerable<RobotSettings> settings) { var traderSet = new
I wrote the following extension method to get an element from a dictionary, or
I found that dictionary lookup could be very slow if compared to flat array
Taking over some code from my predecessor and I found a query that uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.