PHP Classes

File: class_specif_examples.php

Recommend this page to a friend!
  Classes of MARY Matthieu   class_specif   class_specif_examples.php   Download  
File: class_specif_examples.php
Role: Example script
Content type: text/plain
Description: examples of use this class
Class: class_specif
Determine OS specific file parameters
Author: By
Last change:
Date: 20 years ago
Size: 788 bytes
 

Contents

Class file image Download
<?php
require_once "class_specif.php";
// for windows users uncomments theses lines
/*
$aTest = array("../../test.php",
               "c:\windows",
               "test.php");
check($aTest);
*/

// for linux users uncomments theses lines
/*
$aTest = array("../../test.php",
               "test.php",
               "/home/root",
               "/tmp");
check($aTest);
*/
function check($aTest){
         foreach(
$aTest as $id => $path){
              
$pattern = '^('.addslashes(realpath($_SERVER['DOCUMENT_ROOT'])).')';
              
$specif = new specif(preg_match("/^($pattern)/",realpath($path)));
               echo
"for path [".$path."] you have the path delimiter [".$specif->Path_delimiter()."]".$specif->Endline();
         }
//foreach
}//check

?>