本文整理匯總了PHP中Str::rand方法的典型用法代碼示例。如果您正苦於以下問題:PHP Str::rand方法的具體用法?PHP Str::rand怎麽用?PHP Str::rand使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Str
的用法示例。
在下文中一共展示了Str::rand方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: convert
public static function convert($c)
{
$c = trim($c);
if ('' == $c) {
return '';
}
$no = Str::rand(4);
$arr = explode("\n", $c);
$str = '<table class="magnet table table-striped" style="font-size:12px;"><thead><tr><th>SimCD 磁力下載 <span class="pull-right">建議使用迅雷離線下載、QQ旋風極速下載</span></th><td></td></tr></thead><tbody>';
foreach ($arr as $magnet) {
$magnet = str_replace('(ED2000.COM)', '', $magnet);
$magnet = self::normalization($magnet);
$name = self::name($magnet);
if ('' == $name) {
$name = $magnet;
}
$str .= '<tr><td style="word-break:break-all;"><input type="checkbox" class="chk" name="chk' . $no . '[]" value="' . $magnet . '" onclick="thunder.check(\'' . $no . '\');" checked="checked" /> <a rel="nofollow" href="' . $magnet . '">' . $name . '</a></td></tr>';
}
$str .= '<tr><td><label for="chkall' . $no . '"><input type="checkbox" class="chkall" id="chkall' . $no . '" onclick="thunder.checkAll(\'' . $no . '\',this.checked,event)" checked="checked" /> 全選' . '</label></td></tr><tr><td><input type="button" id="copylinks' . $no . '" class="btn btn-success copylinks" title="複製選中鏈接" value="複製選中鏈接" /> <span id="copied' . $no . '" style="display:none;" class="text-success">√ 已複製</span>
</td></tr>';
$str .= '</body></table>';
return $str;
}
示例2: hash_password
public static function hash_password($password)
{
$salt = Str::rand();
return $password = sha1($salt . $password) . ':' . $salt;
}
示例3: _restart
protected function _restart()
{
$this->regenerate();
$return = $this->_start(Str::rand());
$this->_sync();
$this->_data =& $_SESSION;
return $return;
}
示例4: setELE
function setELE()
{
$this->var = "uploader_" . Str::rand(4);
$this->uploadBtn = "uploader_btn_" . Str::rand(4);
}