function GrabImage($url,$filename) {
	if($url==""):return false;endif;

	ob_start();
	readfile($url);
	$img = ob_get_contents();
	ob_end_clean();
	$size = strlen($img);

	//"../../images/books/"为存储目录,$filename为文件名
	$fp2=@fopen("upfile/".$filename, "a");
	fwrite($fp2,$img);
	fclose($fp2);

	return $filename;
}
$filename=GrabImage("http://pic.111cn.net/enkj976.gif","11.jpg");

 

$men = new memcache();
    // you can replace localhost by memcached server ip addr and port no.
$men->connect('localhost','11211');
$men->add("mystr","this is a test",MEMCACHE_COMPRESSED,3600);
$str=$men->get("mystr");
echo $str; 

 

相关文章:

  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-04
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2022-01-16
相关资源
相似解决方案