• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getJSON函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getJSON函数的典型用法代码示例。如果您正苦于以下问题:PHP getJSON函数的具体用法?PHP getJSON怎么用?PHP getJSON使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getJSON函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: actEdit

 function actEdit()
 {
     global $ST, $get;
     $field = array('u_id' => $get->getInt('id'), 'login' => '', 'status' => 1, 'name' => '', 'company' => '', 'last_name' => '', 'first_name' => '', 'middle_name' => '', 'phone' => '', 'city' => '', 'address' => '', 'street' => '', 'house' => '', 'flat' => '', 'porch' => '', 'floor' => '', 'mail' => '', 'avat' => '', 'balance' => 0, 'discount' => 0, 'type' => '', 'other_info' => '');
     $other_info = array('inn' => '');
     if ($field['u_id']) {
         $rs = $ST->select("SELECT " . join(',', array_keys($field)) . " FROM sc_users WHERE u_id=" . $field['u_id']);
         if ($rs->next()) {
             $field = $rs->getRow();
             if ($oi = getJSON($field['other_info'])) {
                 $field = array_merge($field, $oi);
             }
             if (in_array($field['type'], array('partner'))) {
                 $rs = $ST->select("SELECT * FROM sc_partner_data WHERE userid=" . $field['u_id']);
                 if ($rs->next()) {
                     $field['ank'] = $rs->getRow();
                     $field['ank']['flowers'] = @unserialize($field['ank']['flowers']);
                 }
             }
         }
     }
     $field['ank_flowers'] = $this->enum('ank_flowers');
     $field['groups'] = $this->enum('u_type');
     $this->explorer[] = array('name' => 'Редактировать');
     $this->display($field, dirname(__FILE__) . '/users_edit.tpl.php');
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:26,代码来源:AdminUsr.class.php


示例2: actULogin

 /**
  * http://ulogin.ru/constructor.php
  *
  */
 function actULogin()
 {
     $s = file_get_contents('http://ulogin.ru/token.php?token=' . $_POST['token'] . '&host=' . $_SERVER['HTTP_HOST']);
     $user = getJSON($s);
     //$user['network'] - соц. сеть, через которую авторизовался пользователь
     //$user['identity'] - уникальная строка определяющая конкретного пользователя соц. сети
     //$user['first_name'] - имя пользователя
     //$user['last_name'] - фамилия пользователя
     my_session_start();
     $login = $user['network'] . $user['uid'];
     $rs = DB::select("SELECT * FROM sc_users WHERE login='{$login}'");
     $data = array('name' => "{$user['first_name']} {$user['last_name']}");
     if ($rs->next()) {
         DB::update('sc_users', $data, "u_id={$rs->getInt('u_id')}");
         $_SESSION['_USER']['u_id'] = $rs->getInt('u_id');
         $this->setUser($rs->getRow());
     } else {
         $data['login'] = $login;
         $data['type'] = 'user';
         $id = DB::insert('sc_users', $data);
         $_SESSION['_USER']['u_id'] = $id;
         $this->setUser($data);
     }
     header('Location: /');
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:30,代码来源:Join.class.php


示例3: __construct

 public function __construct()
 {
     $this->projects = getJSON('projects.php');
     if (file_exists(BASE_PATH . "/data/" . $_SESSION['user'] . '_acl.php')) {
         $this->assigned = getJSON($_SESSION['user'] . '_acl.php');
     }
 }
开发者ID:codiad,项目名称:codiad,代码行数:7,代码来源:class.project.php


示例4: Load

 public function Load()
 {
     if (!file_exists(DATA . "/settings.php")) {
         saveJSON('settings.php', array($this->username => array('codiad.username' => $this->username)));
     }
     $settings = getJSON('settings.php');
     echo formatJSEND("success", $settings[$this->username]);
 }
开发者ID:practico,项目名称:Codiad,代码行数:8,代码来源:class.settings.php


示例5: getOwnDictionary

function getOwnDictionary()
{
    if (!file_exists(DATA . "/config/" . USERDIC)) {
        return "";
    }
    $content = getJSON(USERDIC, "config");
    return $content['dictionary'];
}
开发者ID:Andr3as,项目名称:Codiad-CodeSpell,代码行数:8,代码来源:controller.php


示例6: centerMap

function centerMap($location)
{
    $rawjson = getJSON($location);
    $json = json_decode($rawjson);
    $general_lat = $json->results[0]->geometry->location->lat;
    $general_lng = $json->results[0]->geometry->location->lng;
    return $general_lat . " " . $general_lng;
}
开发者ID:sweldon,项目名称:stormplot,代码行数:8,代码来源:getxml_noproxy.php


示例7: requireParam

function requireParam($argName)
{
    $body = getJSON();
    if (!isset($body) || !property_exists($body, $argName)) {
        error('Missing parameter: ' . $argName, 501);
        return;
    }
    return $body->{$argName};
}
开发者ID:RHY3756547,项目名称:FreeSO,代码行数:9,代码来源:utils.php


示例8: getJSON

 public function getJSON()
 {
     $o_return = array();
     if (!is_null($this->is_type)) {
         $o_return["push_notification_type"] = $this->is_type;
     }
     if (!is_null($this->io_settlement_batch)) {
         $o_return["push_notification_settlement_batch"] = $this->io_settlement_batch . getJSON();
     }
     if (!is_null($this->io_bank_account_transaciton)) {
         $o_return["push_notification_bank_account_transaction"] = $this->io_bank_account_transaciton . getJSON();
     }
     return $o_return;
 }
开发者ID:omusico,项目名称:RentSquare,代码行数:14,代码来源:PushNotification.php


示例9: open

 public function open()
 {
     $this->existDir();
     $msg = array();
     $msg['content'] = json_encode(getJSON($this->getFileName(), "config"));
     $msg['name'] = basename($this->getFileName(), ".php") . ".json";
     $msg['mtime'] = filemtime($this->getFilePath());
     if ($msg['content'] !== false) {
         $msg['status'] = "success";
     } else {
         $msg['status'] = "error";
         $msg['message'] = "Failed to open file!";
     }
     return json_encode($msg);
 }
开发者ID:practico,项目名称:Codiad-CodeSettings,代码行数:15,代码来源:class.settings.php


示例10: getByIp

 public function getByIp($ip)
 {
     if (count(explode(".", $ip)) != 4) {
         return getJSON($this->err['wrong_ip']);
     }
     $ip = $this->padIP($ip);
     if (!$ip) {
         return $this->getJSON($this->err['wrong_ip']);
     }
     $this->get_by_ip->execute(array(":ip" => $ip));
     $rs = $this->get_by_ip->fetch(PDO::FETCH_ASSOC);
     if (!$rs) {
         return $this->getJSON($this->err['no_ip']);
     }
     $answer = array("country_code" => $rs['country_code'], "country_name" => $rs['country_name'], "isp_name" => $rs['isp_name'], "range" => array("start" => $this->padIP($rs['ipv4_range_start'], true), "end" => $this->padIP($rs['ipv4_range_end'], true)));
     return $this->getJSON($answer);
 }
开发者ID:hozakar,项目名称:ip2country,代码行数:17,代码来源:IPList.class.php


示例11: Authenticate

 public function Authenticate()
 {
     $pass = false;
     $this->EncryptPassword();
     $users = getJSON('users.php');
     foreach ($users as $user) {
         if ($user['username'] == $this->username && $user['password'] == $this->password) {
             $pass = true;
             $_SESSION['user'] = $this->username;
             if ($user['project'] != '') {
                 $_SESSION['project'] = $user['project'];
             }
         }
     }
     if ($pass) {
         echo formatJSEND("success", array("username" => $this->username));
     } else {
         echo formatJSEND("error", "Incorrect Username or Password");
     }
 }
开发者ID:nashant,项目名称:Codiad,代码行数:20,代码来源:class.user.php


示例12: KeywordLink_insTB

function KeywordLink_insTB($target, $mother)
{
    global $configVal;
    requireComponent('Textcube.Function.misc');
    $data = setting::fetchConfigVal($configVal);
    if (!$data['apikey']) {
        return $target . "<p><font color=red>※API 키가 입력되어있지 않습니다 by KeywordLink Plugin※</font></p>";
    } else {
        $apikey = $data['apikey'];
    }
    $obj = getJSON($target, $apikey);
    //JSON결과 OBJ변수에 담기
    $itemCount = $obj->itemCount;
    //키워드 문맥 추출 결과 총 갯수
    // 본문 키워드 추출후 카운트 갯수에 따라 테이블 줄수를 증가시켜 출력
    if ($itemCount > 0) {
        $target = $target . "\r\n\t\t\t<p>\r\n\t\t\t<table border=0 cellpadding=0 cellspacing=0> \r\n \r\n\r\n\t\t\t<table border=0 cellpadding=5 cellspacing=1> \r\n\t\t\t<tr>\r\n\t\t\t\t<td bgcolor=black align=center width=110><font color=white>키워드</font></td>\r\n\t\t\t\t<td bgcolor=black align=center width=110><font color=white>중요도</font></td>\r\n\t\t\t\t<td bgcolor=black align=center width=110><font color=white>반복 횟수</font></td>\r\n\t\t\t\t<td bgcolor=black align=center width=110><font color=white>키워드 위치</font></td>\r\n\t\t\t</tr>";
        for ($i = 0; $i < $itemCount; $i++) {
            $target .= "<td bgcolor=white width=110>" . $obj->items[$i]->keyword . "</td>";
            $target .= "<td bgcolor=white width=110><center>" . $obj->items[$i]->score . "</td>";
            $target .= "<td bgcolor=white width=110><center>" . $obj->items[$i]->count . "</center></td>";
            $locationCount = $obj->items[$i]->count;
            if ($locationCount > 1) {
                for ($j = 0; $j < $locationCount; $j++) {
                    $target .= "<td><center>" . $obj->items[$i]->locations[$j] . "</center></td>";
                }
            } else {
                $target .= "<td><center>" . $obj->items[$i]->locations[0] . "</center></td>";
            }
            $target .= "</tr>";
        }
        //}
        $target = $target . "</table>";
    } else {
        return $target . '<p><font color=red>※키워드 추출 결과 : 결과값이 없습니다※</font></p>';
    }
    return $target;
}
开发者ID:iolo,项目名称:open-source-class,代码行数:38,代码来源:index.php


示例13: pull

 public function pull()
 {
     $cli_params = array();
     $cli_params[] = "--non-interactive";
     if ($this->username != '') {
         $cli_params[] = "--username " . $this->username;
     }
     if ($this->password != '') {
         //Need to clean up the password so it can be passed to the cli, If anyone find's or thinks of more let me know [email protected]
         $this->password = str_replace(array("*", "^", "&", '"'), array('\\*', '\\^', '\\&', '\\"'), $this->password);
         $cli_params[] = "--password " . $this->password;
     }
     if ($this->svnrepo) {
         if (!$this->isAbsPath($this->path)) {
             if (!file_exists(WORKSPACE . '/' . $this->path)) {
                 $this->command_exec = "cd " . WORKSPACE . " && svn co \"" . $this->svnrepo . "\" " . $this->path . " " . implode(" ", $cli_params);
             } else {
                 die(formatJSEND("success", array("message" => "Folder already exists")));
             }
         } else {
             if (!file_exists($this->path)) {
                 $this->command_exec = "cd " . WORKSPACE . " && svn co \"" . $this->svnrepo . "\" " . $this->path . " " . implode(" ", $cli_params);
             } else {
                 die(formatJSEND("success", array("message" => "Folder already exists")));
             }
         }
         if ($this->newproject) {
             $this->projects = getJSON('projects.php');
             $this->projects[] = array("name" => $this->name, "path" => $this->path);
             saveJSON('projects.php', $this->projects);
         }
         $this->ExecuteCMD();
         echo formatJSEND("success", array("message" => "Repo cloned"));
     } else {
         echo formatJSEND("error", array("message" => "No Repo specified"));
     }
 }
开发者ID:practico,项目名称:Codiad-SVN,代码行数:37,代码来源:class.svn.php


示例14: session_start

<!DOCTYPE html>
<html lang="en">
    <?php 
include_once './funcs.php';
session_start();
handleAction();
if (!isset($_SESSION['id'])) {
    $pessoa = getJSON();
}
?>

    <head>
        <meta charset="utf-8">
        <title>SafeGuard</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">



        <!-- Le styles -->
        <link href="./css/bootstrap.css" rel="stylesheet">
        <link href="./css/bootstrap-responsive.css" rel="stylesheet">
        <style type="text/css">
            body {
                padding-top: 60px;
                padding-bottom: 40px;
                #map-canvas { height: 100% }
            }
        </style>
开发者ID:CCardosoDev,项目名称:Safeguard,代码行数:30,代码来源:index.php


示例15: getLocalVersion

 public function getLocalVersion()
 {
     if (file_exists(BASE_PATH . "/.git/HEAD")) {
         $tmp = file_get_contents(BASE_PATH . "/.git/HEAD");
         if (strpos($tmp, "ref:") === false) {
             $data[0]['version'] = trim($tmp);
         } else {
             $data[0]['version'] = trim(file_get_contents(BASE_PATH . "/.git/" . trim(str_replace('ref: ', '', $tmp))));
         }
         $data[0]['name'] = "";
         if (file_exists(DATA . "/version.php")) {
             $data[0]['optout'] = "true";
         }
     } else {
         $data = getJSON('version.php');
     }
     return $data;
 }
开发者ID:codiad,项目名称:codiad,代码行数:18,代码来源:class.update.php


示例16: microtime

    return $json;
}
for ($i = 1; $i <= (int) $loops; $i++) {
    echo "Fetching {$i} of {$loops}";
    $time_start = microtime(true);
    $retries = 0;
    while (1) {
        try {
            $packages = getJSON("{$url}/packages.json");
            break;
        } catch (RuntimeException $e) {
            $retries++;
        }
    }
    foreach ($packages['provider-includes'] as $path => $info) {
        $path = str_replace('%hash%', $info['sha256'], $path);
        while (1) {
            try {
                getJSON("{$url}/{$path}");
                break;
            } catch (RuntimeException $e) {
                $retries++;
            }
        }
    }
    $times[] = microtime(true) - $time_start;
    echo ' - time: ' . end($times) . " secs" . ($retries ? " (with {$retries} retries)" : '') . "\n";
}
sort($times);
$middle = floor($loops / 2);
echo "\nMin:    " . min($times) . " secs\nMax:    " . max($times) . " secs\nMean:   " . array_sum($times) / $loops . " secs\nMedian: " . ($loops % 2 === 0 ? ($times[$middle] + $times[$middle + 1]) / 2 : $times[$middle]) . " secs\n";
开发者ID:balbuf,项目名称:composer-wp,代码行数:31,代码来源:time-provider-download.php


示例17: getJSON

            <form>
            <?php 
        break;
        //////////////////////////////////////////////////////////////////////
        // Set Project Access
        //////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////
    // Set Project Access
    //////////////////////////////////////////////////////////////////////
    case 'projects':
        // Get project list
        $projects = getJSON('projects.php');
        // Get control list (if exists)
        $projects_assigned = false;
        if (file_exists(BASE_PATH . "/data/" . $_GET['username'] . '_acl.php')) {
            $projects_assigned = getJSON($_GET['username'] . '_acl.php');
        }
        ?>
            <form>
            <input type="hidden" name="username" value="<?php 
        echo $_GET['username'];
        ?>
">
            <label><?php 
        i18n("Project Access for ");
        echo ucfirst($_GET['username']);
        ?>
</label>
            <select name="access_level" onchange="if($(this).val()=='0'){ $('#project-selector').slideUp(300); }else{ $('#project-selector').slideDown(300).css({'overflow-y':'scroll'}); }">
                <option value="0" <?php 
        if (!$projects_assigned) {
开发者ID:unix4you2,项目名称:practico-ide,代码行数:31,代码来源:dialog.php


示例18: getFacturas

function getFacturas()
{
    $sql = 'SELECT * FROM vista_invoices';
    return getJSON($sql);
}
开发者ID:roycer,项目名称:BD2_01,代码行数:5,代码来源:factura.php


示例19: foreach

             $u++;
             if ($objval != "") {
                 $finalfile .= "{$objid}: {$objval}\n";
             }
             if ($u == $numberofkeys) {
                 // last
                 $finalfile .= "\n\n";
             }
         }
     }
 }
 //////////
 if ($usergroup >= 4) {
     foreach ($FourPackages as $package) {
         $thisident = $debnames[$package];
         $package_stuff = getJSON("all_packages/{$thisident}");
         $numberofkeys = count(array_keys($package_stuff));
         $y = 0;
         foreach ($package_stuff as $objid => $objval) {
             $y++;
             if ($objval != "") {
                 $finalfile .= "{$objid}: {$objval}\n";
             }
             if ($y == $numberofkeys) {
                 // last
                 $finalfile .= "\n\n";
             }
         }
     }
 }
 file_put_contents("Packages", $finalfile);
开发者ID:pyrotuc,项目名称:Cydia-UDID-Protected-Repo-PHP,代码行数:31,代码来源:repofiles.php


示例20: getJSON

        } else {
            // If it doesn't exist
            $userudid = $_POST['udid'];
            $newuserlevel = $_POST['level'];
            $newusername = $_POST['name'];
            $oldarray = getJSON("approved_udids_2");
            $newarray = array($userudid, $newuserlevel, $newusername);
            array_push($oldarray, $newarray);
            saveJSON("approved_udids_2", $oldarray);
            echo "User added!";
            $finaladdr = $CurrentDirectory . "ManageUDID.php";
            echo "<META http-equiv='refresh' content='1;URL={$finaladdr}'>";
        }
    } else {
        // Otherwise, show.
        $approved_udids = getJSON("approved_udids_2");
        if ($detect->isiOS()) {
            ?>
<!DOCTYPE html>
<html>
<head>
    <link href="ios7css.css" rel="stylesheet">
    <meta content="width=device-width, user-scalable=no" name="viewport">
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"><title>All UDIDs</title></head><body>
<!--	<ul><li><p>Hello, <?php 
            // echo $_SERVER["HTTP_X_MACHINE"];
            ?>
!</p></li></ul> -->
    <header><h1>All UDIDs</h1></header>
    <h2>Users</h2>
		<ul><li><p><?php 
开发者ID:pyrotuc,项目名称:Cydia-UDID-Protected-Repo-PHP,代码行数:31,代码来源:ManageUDID.php



注:本文中的getJSON函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getJSONobj函数代码示例发布时间:2022-05-15
下一篇:
PHP getJS函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap