i want to open a file, say config.php to read from, i am using openclose.php to do the opening and reading.
in config.php there are variables set like:
<?
$var1 = 'php coding is fun';
$var2 = 'i like open source';
$var3 = 'string3';
<............bunch of other crap.........................>
?>
how do i read those variables and then write them to openclose.php?
so far i have:
<?
$fh = fopen('config.php', 'r');
if (!$fh) {
echo "Couldn't open config.php, make sure you are in the correct directory.";
} else {
echo "Opened config.php, begin writing shortly.<br><br>";
<..........need some direction here............>
if (!fclose($fh)) {
echo "Did not properly close config.php.";
} else {
echo "Closed config.php for reading.";
}
}
?>