如何在具有不同值的同一页面上两次调用php函数 [英] how to call a php function twice on the same page with different values
问题描述
功能数据($ 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屋!