小编Roy*_*718的帖子

PHP scandir 的 url

如何将 scandir 与 URL 一起使用。现在看来 PHP 并没有将 URL 视为 URL。有没有办法在 scandir 中使用 URL?

<form action="new_exercise.php?id=<?php echo $new_id; ?>" method="post">
        <input class="" type="text" name="name_exe" required placeholder="Project naam">
        <select name="audio" required>
          <option></option>
          <?php
          $path = 'URL comes here';
          $results = scandir($path);
          foreach ($results as $result) {
              if ($result === '.' or $result === '..') continue;

              if (is_dir($path . '/' . $result)) {
                  echo "<option>" . $result . "</option>";
              }
          }
          ?>
        <select>
        <input class="btn-success" type="submit" name="submit" value="Maak nieuwe opdracht">
    </form>
Run Code Online (Sandbox Code Playgroud)

php url scandir

2
推荐指数
1
解决办法
6142
查看次数

标签 统计

php ×1

scandir ×1

url ×1