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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:37:26+00:00 2026-06-08T20:37:26+00:00

I am trying to echo a setting on the second level of an array

  • 0

I am trying to echo a setting on the second level of an array in my wordpress options and having some trouble getting the variable. This code DOES work:

 <?php foreach($area['fields'] as $field): ?>
 <?php if ($field['id'] == 'show_border')
  {echo ' show_border';} ?>
 <?php endforeach; ?>

That simply checks if there is a field that asks if you want to show a border and if there is it echos whatever I want, regardless of what the field is set at for actually showing the border or not.

What I am trying to do is to just echo the value that is set in the field “show_border”.

Any idea how I would do this?

edit

array(11) {
  [0]=>
  array(3) {
    ["name"]=>
    string(10) "# of posts"
    ["id"]=>
    string(5) "posts"
    ["type"]=>
    string(4) "text"
  }
  [1]=>
  array(5) {
    ["name"]=>
    string(13) "posts per row"
    ["id"]=>
    string(13) "posts_per_row"
    ["type"]=>
    string(6) "select"
    ["default"]=>
    int(3)
    ["options"]=>
    array(8) {
      [1]=>
      int(1)
      [2]=>
      int(2)
      [3]=>
      int(3)
      [4]=>
      int(4)
      [5]=>
      int(5)
      [6]=>
      int(6)
      [7]=>
      int(7)
      [8]=>
      int(8)
    }
  }
  [2]=>
  array(5) {
    ["name"]=>
    string(11) "header type"
    ["id"]=>
    string(13) "f_header_type"
    ["type"]=>
    string(6) "select"
    ["default"]=>
    string(2) "h4"
    ["options"]=>
    array(6) {
      ["h1"]=>
      string(2) "h1"
      ["h2"]=>
      string(2) "h2"
      ["h3"]=>
      string(2) "h3"
      ["h4"]=>
      string(2) "h4"
      ["h5"]=>
      string(2) "h5"
      ["h6"]=>
      string(2) "h6"
    }
  }
  [3]=>
  array(5) {
    ["name"]=>
    string(5) "icon?"
    ["id"]=>
    string(9) "show_icon"
    ["type"]=>
    string(5) "radio"
    ["default"]=>
    string(3) "yes"
    ["options"]=>
    array(2) {
      ["yes"]=>
      string(3) "yes"
      ["no"]=>
      string(2) "no"
    }
  }
  [4]=>
  array(5) {
    ["name"]=>
    string(13) "icon location"
    ["id"]=>
    string(13) "icon_location"
    ["type"]=>
    string(6) "select"
    ["default"]=>
    string(4) "left"
    ["options"]=>
    array(3) {
      ["left"]=>
      string(4) "left"
      ["right"]=>
      string(5) "right"
      ["top"]=>
      string(3) "top"
    }
  }
  [5]=>
  array(5) {
    ["name"]=>
    string(10) "show text?"
    ["id"]=>
    string(9) "show_text"
    ["type"]=>
    string(5) "radio"
    ["default"]=>
    string(3) "yes"
    ["options"]=>
    array(2) {
      ["yes"]=>
      string(3) "yes"
      ["no"]=>
      string(2) "no"
    }
  }
  [6]=>
  array(5) {
    ["name"]=>
    string(12) "show border?"
    ["id"]=>
    string(11) "show_border"
    ["type"]=>
    string(5) "radio"
    ["default"]=>
    string(2) "no"
    ["options"]=>
    array(3) {
      ["top"]=>
      string(3) "top"
      ["bot"]=>
      string(3) "bot"
      ["no"]=>
      string(2) "no"
    }
  }
  [7]=>
  array(5) {
    ["name"]=>
    string(8) "category"
    ["id"]=>
    string(8) "category"
    ["type"]=>
    string(6) "select"
    ["multiple"]=>
    bool(true)
    ["options"]=>
    array(2) {
      [4]=>
      string(7) "feature"
      [3]=>
      string(6) "slider"
    }
  }
  [8]=>
  array(4) {
    ["name"]=>
    string(14) "custom classes"
    ["id"]=>
    string(14) "custom_classes"
    ["type"]=>
    string(4) "text"
    ["default"]=>
    string(0) ""
  }
  [9]=>
  array(5) {
    ["name"]=>
    string(10) "read more?"
    ["id"]=>
    string(9) "read_more"
    ["type"]=>
    string(5) "radio"
    ["default"]=>
    string(3) "yes"
    ["options"]=>
    array(2) {
      ["yes"]=>
      string(3) "yes"
      ["no"]=>
      string(2) "no"
    }
  }
  [10]=>
  array(4) {
    ["name"]=>
    string(14) "read more text"
    ["id"]=>
    string(14) "read_more_text"
    ["type"]=>
    string(4) "text"
    ["default"]=>
    string(16) "Continue reading"
  }
}

I am trying to get a value like [“id”]=> “show_border” and echo it’s value.

  • 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-06-08T20:37:28+00:00Added an answer on June 8, 2026 at 8:37 pm

    Basically you can’t get the form value in PHP which you’re going to select from the form which was already loaded on the server-side.

    It’s like going from the future to the past.

    You should use Javascript code + AJAX, instead of PHP, but it’ll be much more complex.
    Without knowing the full source of the site, it’s not possible to tell you in one simple answer.

    Also it depends on your development skills.

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

Sidebar

Related Questions

I'm trying to echo the XML content at this URL but I'm having difficulty.
im trying to echo mediaplayer embed code with IF statement. is there any way
Hello im trying to echo only the 50 letters, but something in my code
I am trying to echo a result from xml into my html code form
I am getting the Resource id #3 error when I am trying to echo
just trying to add some setting for the admin in a database entry. i've
I am setting a session variable inside a function studNameDetails1() while I am trying
I'm trying to learn to write a WordPress plugin by setting myself a goal
I've got this problem when trying to construct a variable name (which should output
I need some help setting up a PHP array. I get a little lost

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.