Answers for "array to js 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
0

dump php array into javascript array

//in js do this
var masterarray =  <?php echo '["' . implode('", "', $masterarray) . '"]' ?>;
Posted by: Guest on November-02-2020

Browse Popular Code Answers by Language