| 1 |
<?php |
| 2 |
|
| 3 |
error_reporting(E_ALL); |
| 4 |
set_time_limit(0); |
| 5 |
|
| 6 |
date_default_timezone_set('Europe/London'); |
| 7 |
|
| 8 |
?> |
| 9 |
<html> |
| 10 |
<head> |
| 11 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 12 |
|
| 13 |
<title>PHPExcel Examples</title> |
| 14 |
|
| 15 |
</head> |
| 16 |
<body> |
| 17 |
|
| 18 |
<?php |
| 19 |
|
| 20 |
$exampleTypeList = glob('./*',GLOB_ONLYDIR); |
| 21 |
|
| 22 |
foreach($exampleTypeList as $exampleType) { |
| 23 |
|
| 24 |
echo '<h1>PHPExcel ' . pathinfo($exampleType,PATHINFO_BASENAME) . ' Examples</h1>'; |
| 25 |
|
| 26 |
$exampleList = glob('./'.$exampleType.'/*.php'); |
| 27 |
|
| 28 |
foreach($exampleList as $exampleFile) { |
| 29 |
$fileData = file_get_contents($exampleFile); |
| 30 |
|
| 31 |
$h1Pattern = '#<h1>(.*?)</h1>#'; |
| 32 |
$h2Pattern = '#<h2>(.*?)</h2>#'; |
| 33 |
|
| 34 |
if (preg_match($h1Pattern, $fileData, $out)) { |
| 35 |
$h1Text = $out[1]; |
| 36 |
$h2Text = (preg_match($h2Pattern, $fileData, $out)) ? $out[1] : ''; |
| 37 |
|
| 38 |
echo '<a href="',$exampleFile,'">',$h1Text,'</a><br />'; |
| 39 |
if (($h2Text > '') && |
| 40 |
(pathinfo($exampleType,PATHINFO_BASENAME) != 'Calculations')) { |
| 41 |
echo $h2Text,'<br />'; |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
} |
| 46 |
} |
| 47 |
|
| 48 |
?> |
| 49 |
<body> |
| 50 |
</html> |