用php开发API接口

比如: 接口文件的url是:http://url.com/api.php?id=001 接口文件程序: <?php //get接受传值 $id = $_GET['id']; //执行函数 api($id); //定义函数 function api($id){     //函数体     $result = array(1,2,3);     return $result; } ?>

转载于:https://my.oschina.net/itfanr/blog/195609

猜你喜欢

转载自blog.csdn.net/weixin_33743248/article/details/91799589