本文整理匯總了PHP中parseMemcacheResults函數的典型用法代碼示例。如果您正苦於以下問題:PHP parseMemcacheResults函數的具體用法?PHP parseMemcacheResults怎麽用?PHP parseMemcacheResults使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了parseMemcacheResults函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sendMemcacheCommand
function sendMemcacheCommand($server, $port, $command)
{
$s = @fsockopen($server, $port);
if (!$s) {
die("Cant connect to:" . $server . ':' . $port);
}
fwrite($s, $command . "\r\n");
$buf = '';
while (!feof($s)) {
$buf .= fgets($s, 256);
if (strpos($buf, "END\r\n") !== false) {
// stat says end
break;
}
if (strpos($buf, "DELETED\r\n") !== false || strpos($buf, "NOT_FOUND\r\n") !== false) {
// delete says these
break;
}
if (strpos($buf, "OK\r\n") !== false) {
// flush_all says ok
break;
}
}
fclose($s);
return parseMemcacheResults($buf);
}
示例2: sendMemcacheCommand
function sendMemcacheCommand($server, $port, $command)
{
$s = fsockopen($server, $port);
if (!$s) {
die("Cant connect to:" . $server . ':' . $port);
}
fwrite($s, $command . "\r\n");
$buf = '';
while (!feof($s) && strpos($buf, "END\r\n") === false) {
$buf .= fgets($s, 256);
}
fclose($s);
return parseMemcacheResults($buf);
}