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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:45:23+00:00 2026-05-25T20:45:23+00:00

How can I test if a posted value from ajax to php is an

  • 0

How can I test if a posted value from ajax to php is an array. I have been trying for hours to figure out but cannot seem to find a way to test accurately for an array. I have tried var_dump, print_r but still not sure. Is there a test in php that I could use to determine if ajax is posting an array. Looking at the code, I think it should be but cannot seem to pass values to ajax from php without getting undefined error.Thanks

php v5.1.6

for(var i = 0;i < $(this).val();i++) {
        $("#BRVbrtrv_boxnumber").append('<div data-role="fieldcontain"><label for="BRVbrtrv_boxnumber" class="ui-input-text">Enter box ' + (i + 1) + ' number:</label><input type="text" name="BRVbrtrv_boxnumber['+i+']" id="BRVbrtrv_boxnumber['+i+']" class="BRV_boxnumber ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c" /></div>')
      }
  • 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-25T20:45:24+00:00Added an answer on May 25, 2026 at 8:45 pm

    to check if a variable is an array you can use is_array() http://php.net/manual/en/function.is-array.php

    I advice sending a json object with ajax to your php or you can do it the xml way too.

    peace

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

Sidebar

Related Questions

I can't figure out why... This works: <?php if($_POST['test']) echo posted; ?> <form method=POST
I am practicing with PHP and AJAX but I have some problems! I'm trying
Can jQuery test an array for the presence of an object (either as part
I have a binary value being URL Encoded, and then POSTed to an HttpServlet.
I'm trying to figure out something having to do with the behavior descibed by
I can for the life of me figure out why I am losing all
I have been googling but so far results found not fully match to my
I'm in a situation where I can only test for the child node, but
I wonder if I can test landscape view using simulator?
It is my understanding that I can test that a method call will occur

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.