本文整理汇总了PHP中control::newHash方法的典型用法代码示例。如果您正苦于以下问题:PHP control::newHash方法的具体用法?PHP control::newHash怎么用?PHP control::newHash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类control
的用法示例。
在下文中一共展示了control::newHash方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: control
<?php
include "../control.php";
$co = new control();
$a = isset($_POST['input']) ? $co->newHash($_POST['input']) : "403";
echo $a;
示例2: json_encode
include "../control.php";
$co = new control();
$commend = $_GET['commend'];
$com = substr($commend, 3);
$re = array("status" => true);
if (substr($commend, 0, 3) == "-c/") {
$search = $co->search($com);
$mass = $search !== false ? $search : $co->fromOther($com);
if ($mass === "This isn't a MD5 hash.") {
$re['status'] = false;
$re['code'] = "403";
} elseif ($mass === "Not found") {
$re['status'] = false;
$re['code'] = "404";
} else {
$a = explode(":<!#:#!>:", $mass);
if (isset($a[1])) {
$re['base'] = $a[1];
}
$re['return'] = $a[0];
}
} elseif (substr($commend, 0, 3) == "-g/") {
$a = $co->newHash($com);
$re['return'] = $a;
$re['base'] = $com;
} else {
$re['status'] = false;
$re['code'] = "405";
}
echo json_encode($re);