neutrall Level: Scholar

 Registered: 28-03-2004 Posts: 43
|
For.. Each with two level array
Here's my problem, in my code, i'm parsing a ini file :
<?php $TplConfig = parse_ini_file('templates/basic.ini', TRUE); ?>
|
Here's a example of the content of the css ini file :
[css_files]
file1=css/{race_name}.css
file2=css/layout.css
file3=css/common.css |
One of the area in the parse ini file is a listing of css file, so I tried the folowing :
<?php
$CssInsert = '';
foreach ($CssPage as $TplConfig['css_files']) {
$CssInsert .= '<link rel="stylesheet" type="text/css" href="' . $TemplateDir . $CssPage . '">';
echo $TemplateDir . $CssPage;
}
?>
|
I know I can acces them manually by calling directly to the item in the array :
<?php $TplConfig['css_files']['file1'] ?>
But I the ini can contain a unlimited amount of css file.
Can anyone help?
Daniel B.
____________________________
A Stick give a wise man something to think about... and a fool, something to put in is mouth.
|