addFile('./coords.txt'); /** * Le format du fichier n'est pas "X,Y", on change donc l'expression régulière (plus d'infos ici : http://fr.php.net/manual/en/reference.pcre.pattern.syntax.php) * File format isn't "X,Y", so we have to change regular expression (more information here : http://us.php.net/manual/en/reference.pcre.pattern.syntax.php) * * 1234,1234 => /^(\d+),(\d+)$/m * 1234x1234 => /^(\d+)x(\d+)$/m * 1234 1234 => /^(\d+) (\d+)$/m * 1234(tab)1234 => /^(\d+)\t(\d+)$/m * 1234,1234,(whatever/n'importe quoi) => /^(\d+),(\d+),.*$/m **/ $heatmap->regular = '/^(\d+)x(\d+)$/m'; /** Fichiers temporaires / Temporary files */ $heatmap->cache = '.'; /** Fichiers générés / Generated files */ $heatmap->path = '.'; /** Fichier final / Final file */ $heatmap->file = 'resultfromfile-%d.png'; /** * On force la hauteur finale (attention à la consommation mémoire dans ce cas !) * Forcing final height (take care of the memory consumption in such case!) **/ $images = $heatmap->generate(200, 100); echo 'Résultats/Results: '; if ($images === false) { echo 'error: '.$heatmap->error; } else { echo '
';
	print_r($images);
	echo '
'; echo '

'; for ($i = 0; $i < $images['count']; $i++) { echo ' Image ', $i, '
'; } echo '

'; } ?>