J'ai un code qui lit un fichier csv comprennant 3 colonne (mois, date et fichier), j'aimerais utiliser un fichier css (dont le nom se trouve dans la 3ie colonne du csv) en fonction des deux première colonne mais mon code ne marche pas, pourquoi?
Code : Tout sélectionner
<?php
$monthCheck = date('F');
$dayCheck = date('d');
$fp = fopen('http://multi-grafe.com/mapp/wp-content/themes/lamapp/date.csv', 'r');
// Headrow
$head = fgetcsv($fp, 4096, ';', '"');
// Rows
while($column = fgetcsv($fp, 4096, ';', '"'))
{
// This is a great trick, to get an associative row by combining the headrow with the content-rows.
$column = array_combine($head, $column);
}
if ($monthCheck == $column['mois'] && $dayCheck == $column['date']){?>
<link href="<?php bloginfo('template_url'); ?>/css/<?php $column['fichier'] ?>" rel="stylesheet" type="text/css" media="screen" />
<?php
} else {
}
?>