excite.co.jp 翻译代码 PHP 示例

<?php
/**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 2014-12-02
* Time: 14:51
*/
set_time_limit(0);
include "Snoopy.class.php";
$snoopy = new Snoopy;
$submit_url = "http://www.excite.co.jp/world/chinese/";

$submit_vars["before"] = "日语";
$submit_vars["after"] = "";
$submit_vars["wb_lp"] = "JACH";
$submit_vars["big5"]="no";
$submit_vars["start"] = "%E7%BF%BB+%E8%A8%B3";
$snoopy->submit($submit_url,$submit_vars);
$result=$snoopy->getResults();
preg_match("/<textarea id=\"after\" cols=\"37\" rows=\"13\" name=\"after\">(.*)\<\/textarea\>/",$result,$match);
$match[1]=html_entity_decode($match[1]);
print_r($match);