本文整理汇总了PHP中functions::registerUser方法的典型用法代码示例。如果您正苦于以下问题:PHP functions::registerUser方法的具体用法?PHP functions::registerUser怎么用?PHP functions::registerUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类functions
的用法示例。
在下文中一共展示了functions::registerUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: json_encode
<?php
/**
* Created by PhpStorm.
* User: Afolayan
* Date: 25/1/2016
* Time: 2:09 PM
*/
include_once './config.php';
include_once './functions.php';
// response json
$json = array();
$func = new functions();
/**
* Registering a user device
* Store reg id in users table
*/
if (isset($_GET["name"]) && isset($_GET["email"]) && isset($_GET["regId"])) {
$name = $_GET["name"];
$email = $_GET["email"];
$regId = $_GET["regId"];
// GCM Registration ID
// Store user details in db
$time = date('Y-m-d H:i:s');
$func->registerUser($name, $email, $regId);
$json["status"] = "success";
} else {
// user details missing
$json["status"] = "failure";
}
echo json_encode($json, 1, 256);
示例2: array
<?php
/**
* Created by PhpStorm.
* User: Afolayan
* Date: 27/1/2016
* Time: 2:33 PM
*/
include_once './functions.php';
$json = array();
$func = new functions();
// to register new device/user
if (isset($_GET['userId']) && isset($_GET['regId']) && isset($_GET['email'])) {
$regId = $_GET['regId'];
$email = $_GET['email'];
$userId = $_GET['userId'];
$time = date('Y-m-d H:i:s');
$f = $func->registerUser($userId, $email, $regId);
$json["id"] = $f;
echo json_encode($json);
}