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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:29:00+00:00 2026-05-23T16:29:00+00:00

I am just doing some experimenting. How do I print the value of this

  • 0

I am just doing some experimenting. How do I print the value of this $chvalues[] or test (as below) it’s an array. Is it possible to print this out as-is? $chvalues[] (yes my input field is properly defined with name=seminar etc…)

$chvalues = array();
if (isset($_POST['seminar'])) {
    foreach ($_POST['seminar'] as $ch => $value) {
        $chvalues[] = $value;
        if(is_array('$chvalues[]')) {
            echo "Yes. It's an Array.";
        }
    }
}

I am trying to test this:

if(is_array('$chvalues[]')) { ...

I get this:

Fatal error: Cannot use [] for reading in...
  • 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-23T16:29:00+00:00Added an answer on May 23, 2026 at 4:29 pm
    1. You are reading the array as a string by using single quotes around it (which should just return false).

    2. You should use if(is_array($chvalues)) without the brackets.

    3. $chvalues will always be an array, because you just assigned it to one the line before, as well as at the start of your code, before the loop.

    Maybe you meant to check $value, or run the is_array() after the loop and not initialize $chvalues as an array before running the loop.

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

Sidebar

Related Questions

I'm basically just doing some tests to figure out a good way to write
I am doing some tests, just to learn (normally i do this in ajax
I was just doing some stuff and wrote this program. I got the following
I'm experimenting with a few ways of doing this but just thought I'd ask
I am doing some experimenting (so the code below has lots of stuff that
I've just started doing some real-world performance testing on my Fluent NHibernate / SQLite
So I'm working on just a learning project to expose myself to doing some
I'm sure I'm just doing something stupid here, but I can't quite figure out
I am doing some experimenting with threads, and made a 'control' method to compare
I've been doing some experimenting with php and html, and I'd like to know

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.