Voici ma fonction :
function file_array($file){
//10027;http://www.test.com;text;link title;
$lines = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($lines as $line_num => $line) {
list($position, $link, $type, $value) = explode(';',$line);
$link = array(array('position' => $position,
'link' => $link,
'type' => $type,
'value' => $value
));
}
return $link;
}
Et voici ce que j'obtient avec un var_dumparray
0 =>
array
'position' => string '10027' (length=5)
'link' => string 'http://www.test.com' (length=19)
'type' => string 'text' (length=4)
'value' => string 'link tiltle' (length=12)
Dans mon fichier il y a 54 enregistrement.J'ai essayé $link[$line_num] = array(array('position' => $position, ... Mais j'obtient une erreur alors me voilà perdu !
Donc comment recevoir tous les résultats ??
Merci de votre soutient !