<?php

$config_file 
'config.conf';

/*    config file        v0.2

    php has a parse_ini function now, but this is still handy..   */

$array_from_file file($config_file);
foreach(
$array_from_file as $conf) {

    
// if first real character isn't '#', ';', or '[', and there is a '=' in the line..
    
if ( (substr(trim($conf),0,1) != '#')
        and (
substr(trim($conf),0,1) != ';')
        and (
substr(trim($conf),0,1) != '[')
        and (
substr_count($conf,'=') >= 1) ) {
        
$eq strpos($conf'=');
        
$config[trim(substr($conf,0,$eq))] = trim(substr($conf$eq+1));
    }
}


unset(
$array_from_file);

echo 
'<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
</head><body>
<div style=width:90%; margin-left: 20%">
The following configuration was pulled from <strong>'
,$config_file,'</strong> ..<br />
<pre>'
;
print_r($config);
echo 
'
</pre>'
;

/*
The config file :

#############################
#    this is a config file     #

# i am a comment
; i am also a comment (for compatability with standard "ini" files)

    var_name  =  setting

your variables are here: $conf['var_name'] = 'setting';

*/
?>
back to the source menu
downloadtest

Welcome to corz.org!

Since switching hosts (I hope you are alright, Ed! Wherever you are …) quite a few things seems to be wonky.

Juggling two energetic boys (of very different ages) on Coronavirus lockdown, I'm unlikely to have them all fixed any time soon. Mail me! to prioritise!