Supprimer un message
ovh
Testé et approuvé :
- <?php
- define("PATH", "."); // place ici le bon chemin sans / final
- header("Content-type: application/json");
- $files = array();
- $iterator = new DirectoryIterator(PATH);
- foreach ($iterator as $fileInfo) {
- if ($fileInfo->isFile()) {
- $files[] = PATH . '/' . $fileInfo->getFilename();
- }
- }
- echo json_encode($files);
- <script type="text/javascript">
- init_map('map');
- $.ajax({
- type: "get",
- url: "test.php",
- datatype: "json",
- success: function(data){
- $(data).each(function(idx, value){
- trace_gpx(value);
- });
- }
- });
- </script>