voici ci dessous mon code + la sortie php + base CSV
vous constaterez que kil lit la colonne A et B de mon csv et qu'il met des ";" pour separer les colonnes
moi ce que je voudrais c'est pouvoir ne lire que a partir de la colonne B et qu'il n'y ai pas de ";" pour separer les colonne dans le php
code :
<html>
<head>
<title>MVM</title>
</head>
<body>
<TABLE border=2 width=975>
<tr>
<td width=158 height=173>
<img src="logo.jpg" width="157.5" height="172.5" alt="" border="0" />
</td>
<td valign="top">
<FONT SIZE=2>
<FONT COLOR="#0000FF">
<div align="right">
<?php
$date = date("d-m-Y");
Print("Nous sommes le $date");
?>
<br>
<FONT SIZE=2>
<?php
$heure = date("H:i");
Print("il est $heure");
?>
</div>
</FONT>
</td>
</tr>
<tr>
<td width=500 height=200>
<?
$separateur=":";
$champ="c:\EasyPHP1-8\www\champ.csv";
function read_csv( $champ, $separateur)
{
if ( $FILE=fopen($champ,"r") )
{
while ($ARRAY[]=fgetcsv($FILE,1024,$separateur));
fclose($FILE) ;
array_pop($ARRAY);
return $ARRAY ;
}
}
$ARRAY=read_csv($champ,$separateur);
?>
<?
$heigh=sizeof($ARRAY);
$width=sizeof($ARRAY[0]);
$ARRAY=array_reverse($ARRAY,false);
echo "<TABLE>";
for($i=0;$i<3;$i++)
{
echo "<TR>\n";
$j=0;
{
echo "<TD>";
if( $ARRAY[$i][$j]=="" )
echo " ";
else
{
echo "<center>";
echo htmlspecialchars($ARRAY[$i][$j], ENT_QUOTES);
echo "</center>";
}
echo "</TD>\n";
}
echo "</TR>\n";
}
echo "</TABLE>\n";
?>
</td>
</tr>
</table>
</body>
</html>
sortie php :07/07/2005;b
07/07/2005;o
05/07/2005;n
base csv :
01/07/2005 r
02/07/2005 u
03/07/2005 o
04/07/2005 j
05/07/2005 n
07/07/2005 o
07/07/2005 b
merci d'avance a tous ceux qui vont m'aider