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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:15:46+00:00 2026-05-24T06:15:46+00:00

I need help here in my practice program. I have a json array: myData=[{plank_number:1,thickness:5,width:7,length_t:8,quantity:1},

  • 0

I need help here in my practice program. I have a json array:

myData=[{"plank_number":"1","thickness":"5","width":"7","length_t":"8","quantity":"1"},
 {"plank_number":"2","thickness":"5","width":"6","length_t":"7","quantity":"1"},
 {"plank_number":"3","thickness":"6","width":"7","length_t":"8","quantity":"1"},
 .........................(could be more)]

this array is generated everytime you add plank in my grid (jqgrid). I also have here a php file with some html tag. What I am confused about is how will I code my .php program so that it will accept my variable myData and create another table in from it.

EDIT

My questions are: How to POST a JSON array to an other page? and,

How to output the JSON array in an html table?
I have a submit button in here in my html file. And my variable myData is from my javascript file. Thanks

  • 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-24T06:15:46+00:00Added an answer on May 24, 2026 at 6:15 am

    You have to use json_decode to convert the post data into a php associative array then you can loop through it and generate the table.
    Something along the lines of….

    <?PHP
    $data = json_decode($_POST['myData'], true); // convert into a php array
    $numrows = count($data); // count the number of rows you need
    
    // generate the table
    echo "<table>";
    echo "<tr><td>plank number</td><td>thickness</td><td>width</td></tr>"; // your headings
    for($i = 0; $i < $numrows; $i++)
    {
        echo "<tr>";
        echo "<td>" . $data[$i]['plank_number'] . "</td>";
        echo "<td>" . $data[$i]['thickness'] . "</td>";
        echo "<td>" . $data[$i]['width'] . "</td>";
        echo "</tr>";
    }
    echo "</table>";
    ?>
    

    http://php.net/manual/en/function.json-decode.php

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

Sidebar

Related Questions

I have a practice project which I need help with. It's a simple MailServer
I think you will loughing at me, but I need help here... I have
Ok need some help here. I have an autocomplete setup to pull from a
i need some help here. I have a dialog box that contains an iFrame
I need help with the best practice to localize asp mvc apps, I saw
i need help with disk_total_space function.. i have this on my code <?php $sql=select
I have a regex call that I need help with. I haven't posted my
Need help here, i need to get the title into the comboboxes named cntpaginaBX
I seem to have hit a wall here and would appreciate some help from
I need help with the method signature on the updateGroup method. Here is the

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.