79699904

Date: 2025-07-13 10:52:24
Score: 1
Natty:
Report link

I found a one possible solution. This strstr() function checks for the specific word journal/ to the string then remove all the characters before it.

<?php
  $journals = glob("{$_SERVER['DOCUMENT_ROOT']}/journal/*");

  foreach($journals as $journal){
    $strippedURL = strstr($journal, 'journal/');
    echo "<a href=\"http://www.example.net/{$strippedURL}\">file</a>\n";
  }
?>
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: bochard