I am getting trouble while converting an array received from mysqli_fetch_all() function to an array of array which can be used with leaflet js
I am getting trouble while converting an array received from mysqli_fetch_all() function to an array of array which can be used with leaflet js
Without being able to see any code you may have, I'd guess your array in php looks like
$myArray = array(array('x1', 'x2'), array('y1', 'y2'));
What you need to do is json_encode it and it will be accessible to your javascript:
<?php $myArray = json_encode($myArray); ?>
<script> var myArray = <?= $myArray ?>; </script>