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 6571917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:56:30+00:00 2026-05-25T14:56:30+00:00

I have a wordy value array without explisit keys for speed reason. And the

  • 0

I have a wordy value array without explisit keys for speed reason. And the keys are populated as numeric keys 0-N automatically:

$array = array('Good old days', 'Bad old days', ....);

The form is filled up with expected key|value pairs:

key=0, value=Good old days

or

<option value="0">Good old days</option>

which is good as I don’t want to have long wordy keys.

Now the issue part is, I know how to fetch the key, but I can not find a way how to display the value out of the given key. Maybe because I have to loop for a condition and than the key is grabbed if the condition met.

How do you grab the value from the given key?

Any hint would be very much appreciated.

UPDATE:

  //If keys are wordy: http://fonts.googleapis.com/css?family=Quattrocento|Droid+Sans|Yanone+Kaffeesatz

  $gwf_settings = array(
    'base_font',
    'article_title',
    'site_name',
    'site_slogan',   
  );


  $gwfs = array();
  foreach($gwf_settings as $key => $gwf_font) { 
    //dsm('KEYS: '. $key); 
    // parent form to check condition if we are using gwf
        if (theme_get_setting($gwf_font) == 'gwf') {
          $values = $gwfs[theme_get_setting($gwf_font .'_gwf')];
            dsm('KEY2: '. theme_get_setting($gwf_font .'_gwf')); //ok, we have the gwf key
            dsm('VALUES: '. $values); // BLANK        
$gwfs[] = str_replace(' ', '+',  $values);
        }       
  }    

  $google_web_fonts = implode('|', $gwfs);

I seem to get stucked with “values”.

UPDATE 2, in case useful to anyone, or any betterment:

          $gwf_settings = array(
            'base_font',
            'article_title',
            'site_name',
            'site_slogan',   
          );

          $gwf_gwf = array(
            'base_font_gwf',
            'article_title_gwf',
            'site_name_gwf',
            'site_slogan_gwf',   
          );  

          foreach($gwf_settings as $key => $gwf_font) {     
            if ( theme_get_setting($gwf_font) == 'gwf' ) {       
              $gwfs = array();
              foreach ($gwf_gwf as $k => $gwf_setting) {   
                $s = theme_get_setting($gwf_setting);         
                $fonts = get_gwf();     
                if ( $s ) { 
                  foreach ($fonts as $f => $val) {
                    if ( $f == $s ) {                 
                      $gwfs[] = str_replace(' ', '+',  $val);
                    }
                  }
                }
              }
            }
          }   

          $google_web_fonts = implode('|', $gwfs); 

        // The final output will be just like with wordy key version: 
//http://fonts.googleapis.com/css?family=Oswald|Yanone+Kaffeesatz|Droid+Sans
  • 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-25T14:56:30+00:00Added an answer on May 25, 2026 at 2:56 pm

    echo $array[0] will print ‘Good old days’.

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

Sidebar

Related Questions

Assuming I have an array of doubles, what's a good algorithm to sample this
I have a HashMap where the key is a word and the value is
I have seven words in the array: string[7] = {x,x,x,x,x,x,x}; the x is generated
I have an array $x with nonzero number of elements. I want to create
I have an array with 250k entities (with a size of 20 bytes) and
i have this json structure and I made it into an array. I was
I'm trying to find the best way to find a value in an array:
I'm working on a script that requires me to have an array with a
I have an array like this $data = array( some => 163, rand =>
i have a status-signal (measured, of a heatpump) in an numpy.ma-array, together with timestamps.

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.