Skip to content

Instantly share code, notes, and snippets.

@hubgit
Created June 28, 2010 16:10

Revisions

  1. hubgit revised this gist Jul 30, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion file-exists-ci.php
    Original file line number Diff line number Diff line change
    @@ -10,5 +10,5 @@ function file_exists_ci($file) {
    if (strtolower($file) == $lowerfile)
    return $file;

    return false;
    return FALSE;
    }
  2. hubgit created this gist Jun 28, 2010.
    14 changes: 14 additions & 0 deletions file-exists-ci.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    <?php

    function file_exists_ci($file) {
    if (file_exists($file))
    return $file;

    $lowerfile = strtolower($file);

    foreach (glob(dirname($file) . '/*') as $file)
    if (strtolower($file) == $lowerfile)
    return $file;

    return false;
    }