Jump to content

wsams

New Members
  • Posts

    2
  • Joined

  • Last visited

wsams's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Just want to note that the same thing happens for file() calls, but you can supply a second argument like the following to prevent that, <?php $files = file("my.log", FILE_IGNORE_NEW_LINES);
  2. I know this is a late reply, but often there's a pesky newline character in your variable sent to filemtime() or other functions. I see this a lot when globbing. The code below removes those line endings. Both \r and \n. $files = glob("*.jpg"); foreach ($files as $file) { $file = preg_replace("/(\r|\n)/", "", $file); $mtime = date("Y-m-d H:i:s", filemtime($file)); print($mtime . "\n"); }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.