// Summary: 客户端 // Author: millken // LastModifed:2008-8-29 13:41 // copyright (c)2008 millken@gmail.com //==================================================== function getsize($url) { $headers = array_change_key_case(get_headers($url, 1), CASE_LOWER); if (!array_key_exists("content-length", $headers)) { return false; } return $headers["content-length"]; } //调试变量 function m_exit($var, $exit = false) { echo "<pre>\n"; print_r($var); echo "</pre>\n"; if ($exit) { exit; } } $s = microtime(true); include 'webremote.php'; $w = new webRemote('http://172.16.1.8/webremote/server.php'); $a = $w->call('file_get_contents', 'http://172.16.1.9/index.php'); //$a = $w->call('test',array('2','3')); $e = microtime(true); echo $s - $e; echo $a;
<?php //==================================================== // FileName: server.php // Summary: 服务端 // Author: millken // LastModifed:2008-8-29 13:41 // copyright (c)2008 millken@gmail.com //==================================================== include 'webremote.php'; $w = new webRemote(); $w->register('md5'); $w->register('test'); $w->register('file_get_contents'); $w->service(); function test($array) { $array['test'] = 'tester'; return $array; }