links for 2006-09-19
-
Google Analytics has tons of features that could fill a series of articles, but today I’ll just point out a few of the useful ones that can help you improve your web site and find out more about your visitors.
Uno de los problemas con los que nos solemos encontrar es leer imágenes en PHP mediante la librería GD sin estar seguros de que tipo de fichero es: JPEG, GIF o PNG. Normalmente solemos mirar la extensión y según sea, abrir el fichero con alguno de los métodos que ofrece GD. Pero hay una solución más sencilla: leer el fichero en un string y crear la imagen usando ese script:
$img_content = file_get_contents($image);
$im = imagecreatefromstring($img_content);
// Para saber el tipo de imagen por si lo necesitamos
$imgtype = exif_imagetype($image);