<?php
header('Content-Type:text/html; charset=utf-8');
echo "<form action='' method='post'>
请输入要查询的单词:<input type='text' name='seach' />
<input type='submit' value='查询' />
<input type='hidden' name='id' value='0' />
</form><hr />";
if(isset($_POST['id'])){
$seach=$_POST['seach'];
$mem=new Memcache();
$mem->connect('127.0.0.1',11211);
$arrs=$mem->get("arr");
$arrs1=$mem->get("arr1");
if(empty($arrs[$seach]) && empty($arrs1[$seach])){
echo "<font color='red' >".$seach."</font>的汉语意思是:"."<font color='blue' >".'没有对应词库'."</font>";
}else if(@$arrs[$seach]){
echo "<font color='red' >".$seach."</font>的汉语意思是:"."<font color='blue' >".$arrs[$seach]."</font>";
}else if($arrs1[$seach]){
echo "<font color='red' >".$seach."</font>的英文意思是:"."<font color='blue' >".$arrs1[$seach]."</font>";
}
$mem=new Memcache();
$mem->connect('127.0.0.1',11211);
$arr=array("name"=>"姓名","apple"=>"苹果","banana"=>"香蕉");
$arr1=array("姓名"=>"name","苹果"=>"apple","香蕉"=>"banana");
$mem->add('arr',$arr,MEMCACHE_COMPRESSED,0);
$mem->add('arr1',$arr1,MEMCACHE_COMPRESSED,0);
header('Content-Type:text/html; charset=utf-8');
echo "<form action='' method='post'>
请输入要查询的单词:<input type='text' name='seach' />
<input type='submit' value='查询' />
<input type='hidden' name='id' value='0' />
</form><hr />";
if(isset($_POST['id'])){
$seach=$_POST['seach'];
$mem=new Memcache();
$mem->connect('127.0.0.1',11211);
$arrs=$mem->get("arr");
$arrs1=$mem->get("arr1");
if(empty($arrs[$seach]) && empty($arrs1[$seach])){
echo "<font color='red' >".$seach."</font>的汉语意思是:"."<font color='blue' >".'没有对应词库'."</font>";
}else if(@$arrs[$seach]){
echo "<font color='red' >".$seach."</font>的汉语意思是:"."<font color='blue' >".$arrs[$seach]."</font>";
}else if($arrs1[$seach]){
echo "<font color='red' >".$seach."</font>的英文意思是:"."<font color='blue' >".$arrs1[$seach]."</font>";
}
$mem=new Memcache();
$mem->connect('127.0.0.1',11211);
$arr=array("name"=>"姓名","apple"=>"苹果","banana"=>"香蕉");
$arr1=array("姓名"=>"name","苹果"=>"apple","香蕉"=>"banana");
$mem->add('arr',$arr,MEMCACHE_COMPRESSED,0);
$mem->add('arr1',$arr1,MEMCACHE_COMPRESSED,0);