PHP generated array and then passed to JS method, PHP generation array js_php Tutorial

Source: Internet
Author: User
Tags javascript array

PHP generated array and then passed to the JS method, PHP generated array js



How do I pass the value of a PHP array to a JavaScript array?

cannot be passed directly, but can use JS Ajax to dynamically invoke PHP array values when the page is loaded
or the array worth string that is processed in PHP is first assigned to the HTML hidden control, and then the hidden value is called with the JS code
In addition, I think, if your data is not a constant change, it is best to use PHP to generate a. js file, this file defines the array, and then file a bit, better

How the values in the PHP array are passed to JS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.