如何在具有不同值的同一页面上两次调用php函数 [英] how to call a php function twice on the same page with different values

查看:109
本文介绍了如何在具有不同值的同一页面上两次调用php函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

功能数据($ table){

global $ realid;

global $ UserData;

$ url =http:// localhost / folder / api / $ table / $ realid;

$ json_decode = json_decode(file_get_contents($ url));

$ UserData = get_object_vars($ json_decode [$ realid]);

}

数据(用户);

数据(user_data);




i希望在同一页面上调用两次不同值的php函数不断告诉我用户表的未定义索引..... help

function data($table){
global $realid;
global $UserData;
$url = "http://localhost/folder/api/$table/$realid";
$json_decode = json_decode(file_get_contents($url));
$UserData = get_object_vars($json_decode[$realid]);
}
data("users");
data("user_data");


i want to call a php function twice on the same page with different values bu it keep telling me Undefined index for users table ..... help

推荐答案

table){

global
table){
global


realid;

global
realid;
global


UserData;
UserData;


这篇关于如何在具有不同值的同一页面上两次调用php函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆