Answers for "pass javascript array to php"

PHP
0

convert a php array into a javascript array

var js_array = [<?php echo '"'.implode('","',  $disabledDaysRange ).'"' ?>];
Posted by: Guest on February-25-2021
1

assign php array into javascript

<script type="text/javascript">

	$(document).ready(function() {
      FACILITY_BOOKING.lst_festival_day = new Array();
      <?php foreach($festival_day as $key => $val) { ?>
        FACILITY_BOOKING.lst_festival_day.push('<?php echo $val; ?>');
      <?php } ?>
    });
</script>
Posted by: Guest on March-22-2021

Code answers related to "pass javascript array to php"

Browse Popular Code Answers by Language