note 39548 added to function.rand

From: Date: Mon, 02 Feb 2004 00:26:03 +0000
Subject: note 39548 added to function.rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-64528@lists.php.net to get a copy of this message
In response to the image caching code... heres a more efficent way to call that. <?php function preventImgCache($path) { $md5 = ""; for($i=0;$i<5;$i++) $md5 = md5($md5 . rand(500, 2000)); return "<img src=\"".$path."?".$md5."\">"; } echo preventImgCache("image.jpg"); ?> ---- Manual Page -- http://www.php.net/manual/en/function.rand.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39548 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39548&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39548&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#64528) next »