Home  >  Article  >  Backend Development  >  How to test memcached in PHP

How to test memcached in PHP

不言
不言Original
2018-07-04 17:27:062448browse

This article mainly introduces the method of testing memcached in PHP, which has certain reference value. Now I share it with everyone. Friends in need can refer to it

1.memcached generates key

 connetct('192.168.1.10') or die ("Could not connect Memcached Server");
	$memcache -> set ('key','Connect Memcached Server sussucfull');
	$get = $memcache -> get('key');
	echo $get;
?>

2.mecached delete key

 connetct('192.168.1.10') or die ("Could not connect Memcached Server");
	//$memcache -> set ('key','Connect Memcached Server sussucfull');  //设置
	//$memcache -> replace('key','New Connect Memcached Server sussucfull');
	$memcache -> delete('key');	//删除
	$get = $memcache -> get('key');//查询
	echo $get;
?>

The above is the entire content of this article. I hope it will be helpful to everyone’s learning. For more related content, please pay attention to PHP Chinese net!

Related recommendations:

Introduction to installing xhprof for performance analysis in PHP 7.1

php How to add the instant push function

The above is the detailed content of How to test memcached in PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn