Código PHP:
$array1;
$array2;
Código PHP:
$total = count($array1);
$total1 = count($array2);
Código HTML:
<script> var array1 = new Array(); var array2 = new Array(); var total = '<?= $total ?>'; var total1 = '<?= $total1 ?>'; <?php for($i=0; $i<$total; $i++) { echo "\narray1[$i] = '$array1[$i]';"; //?>array1['<?= $i ?>'] = '<?= $array1[$i] ?>';<?php } for($j=0; $j<$total1; $j++) { echo "\narray2[$j] = '$array2[$j]';"; //?>array2['<?= $j ?>'] = '<?= $array2[$j] ?>';<?php } ?> </script>
Código HTML:
onclick="funcion(array1,array2,total,total1);"
Código HTML:
<script> function funcion(array1,array2,total,total1) { var array1 = array1; var array2 = array2; var total = total; var total1 = total1; document.write(array1); document.write(array2); document.write(total); document.write(total1); } </script>
bichomen