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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:57:14+00:00 2026-05-11T13:57:14+00:00

Okay, my situation is such: I need to send the contents of a JavaScript

  • 0

Okay, my situation is such: I need to send the contents of a JavaScript array to server where a PHP script will persist individual array entries in a MYSQL database. I am NOT using jQuery but I am about to integrate Prototype framework into my project.

I gather that the JS array can easily be converted to JSON using the toJSON() method provided by Prototype. I could then POST this to my script which would somehow de-JSONise the array and insert the values into DB.

But what I am also interested in is NOT using JSON data-interchange format, but converting the JS array into XML, which can be very easily parsed by the simplexml PHP extension (save myself some development time server-side). My question(s) are thus: should I go for JSON or XML? and How could I turn the JS array into XML? (is there a toXML() method like there is toJSON() in Prototype?)

I am aware of the great variety of very similar questions, but they all seem to ask this question the other way around… converting JSON to JS arrays, and many are jQuery related. So please help me, even if this is potentially a duplicate and you may have answered this some place else.

  • 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. 2026-05-11T13:57:15+00:00Added an answer on May 11, 2026 at 1:57 pm

    You have tried the php_json extension methods? Using them you will be able to turn the JSON object into a PHP Object.

    From there you can do whatever you want. Make an XML string to process with SimpleXML or persist to the DataStore.

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

Sidebar

Related Questions

Okay, here is my situation. I have a page, index.php, which is the mainsite
Okay here's the situation.... I'm working on a my business website. There will be
Okay, weird situation: I need to Debug a VSTO Office Addin. This was written
Okay here's my situation. I have the following branches development development-kirby (270 commits ahead
Okay, here's the situation: I've created a class extending Android's SQLOpenHelper class. I've also
Okay, here's the situation: We have a table of about 50 columns (created by
Okay, so I have my post.php page. If you are not logged in, you'll
Okay, so I'm working on a java server for an Apps backend, it must
Okay - I have a dilemma. So far my script converts page titles into
Okay so my situation at work is that I've written about 200 or so

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.