PHPLiveX - 使用Ajax调用PHP函数

jopen 8年前

PHPLiveX是一个PHP类库可用于在web页面中使用Ajax调用PHP函数。它非常易于使用,在调用一个PHP函数不需要附加额外的功能,包含一个灵活地预加载属性,兼容IE, Opera, Mozilla, Firefox等浏览器。

    function generateRandomCode($length){            $chars = array("1","2","3","4","5","6","a","b","c","d","e","f");            $code = array_rand(array_flip($chars), $length);            return implode($code);        }                include("PHPLiveX.php");        $ajax = new PHPLiveX("generateRandomCode");        $ajax->Run(); // Must be called inside the 'html' or 'body' tags.  

项目主页:http://www.open-open.com/lib/view/home/1337763038105