本文整理汇总了PHP中rep函数的典型用法代码示例。如果您正苦于以下问题:PHP rep函数的具体用法?PHP rep怎么用?PHP rep使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rep函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: input_headlines
function input_headlines($url)
{
$html = cacheurl($url);
preg_match_all('|<h1><a href="/(.*?)/videos/(.*?)/(\\d+)/">(.*?)</a></h1>|', $html, $matches);
foreach ($matches[3] as $key => $row) {
$tmp_array['url'] = "http://www.kabeleins.de/" . $matches[1][$key] . "/" . $matches[2][$key] . "/" . $matches[3][$key];
$tmp_array['title'] = " " . rep($matches[4][$key]);
$out[$tmp_array['title']] = $tmp_array;
}
return $out;
}
示例2: str_zero
function str_zero($arg1, $arg2)
{
if (strstr($arg1, "-") == false) {
$aux = intval($arg2) - strlen($arg1);
if ($aux) {
return rep($aux, "0") . $arg1;
} else {
return $arg1;
}
} else {
return "[{$arg1}]";
}
}
示例3: MAL_PRINT
return MAL_PRINT(MAL_EVAL(READ($str), $repl_env));
}
$repl_env->set(_symbol('+'), function ($a, $b) {
return intval($a + $b, 10);
});
$repl_env->set(_symbol('-'), function ($a, $b) {
return intval($a - $b, 10);
});
$repl_env->set(_symbol('*'), function ($a, $b) {
return intval($a * $b, 10);
});
$repl_env->set(_symbol('/'), function ($a, $b) {
return intval($a / $b, 10);
});
// repl loop
do {
try {
$line = mal_readline("user> ");
if ($line === NULL) {
break;
}
if ($line !== "") {
print rep($line) . "\n";
}
} catch (BlankException $e) {
continue;
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
echo $e->getTraceAsString() . "\n";
}
} while (true);
示例4: rep
if((((isAlliance($newrace) && !isAlliance($oldrace)) || (!isAlliance($newrace) && isAlliance($oldrace))) && $check_guild == 0)||((isAlliance($newrace) && isAlliance($oldrace)) || (!isAlliance($newrace) && !isAlliance($oldrace)))){
delMounts($guid,$oldrace);
addMounts($guid,$newrace);
$aone = $CHDB->selectCell("SELECT `standing` FROM `character_reputation` WHERE guid='$guid' AND faction=72");
$atwo = $CHDB->selectCell("SELECT `standing` FROM `character_reputation` WHERE guid='$guid' AND faction=47");
$athree = $CHDB->selectCell("SELECT `standing` FROM `character_reputation` WHERE guid='$guid' AND faction=69");
$afour = $CHDB->selectCell("SELECT `standing` FROM `character_reputation` WHERE guid='$guid' AND faction=54");
$afive = $CHDB->selectCell("SELECT `standing` FROM `character_reputation` WHERE guid='$guid' AND faction=930");
$hone = $CHDB->selectCell("SELECT `standing` FROM `character_reputation` WHERE guid='$guid' AND faction=76");
$htwo = $CHDB->selectCell("SELECT `standing` FROM `character_reputation` WHERE guid='$guid' AND faction=68");
$hthree = $CHDB->selectCell("SELECT `standing` FROM `character_reputation` WHERE guid='$guid' AND faction=81");
$hfour = $CHDB->selectCell("SELECT `standing` FROM `character_reputation` WHERE guid='$guid' AND faction=530");
$hfive = $CHDB->selectCell("SELECT `standing` FROM `character_reputation` WHERE guid='$guid' AND faction=911");
// If staying the same race, change main reputaion to match new race
$oldrepfunction = rep($oldrace);
$newrepfunction = rep($newrace);
$result5 = $CHDB->select("SELECT * FROM character_reputation WHERE guid='$guid' AND faction='$oldrepfunction'");
foreach($result5 as $result6) {
$oldRep = $result6['standing'];
}
$result7= $CHDB->select("SELECT * FROM character_reputation WHERE guid='$guid' and faction='$newrepfunction'");
foreach($result7 as $result8) {
$newRep = $result8['standing'];
}
if (isAlliance($oldrace)) {
$CHDB->query("UPDATE character_achievement_progress SET counter=10500 WHERE guid='$guid' AND (criteria=2030 or criteria=2031 or criteria=2032 or criteria=2033 or criteria=2034)");
} else {
$CHDB->query("UPDATE character_achievement_progress SET counter=10500 WHERE guid='$guid' AND (criteria=992 or criteria=993 or criteria=994 or criteria=995 or criteria=996)");
}
if (isAlliance($newrace) && !isAlliance($oldrace)) // Sets position to Stormwind if new faction is Alliance and old is Horde
$CHDB->query("UPDATE characters SET position_x = -8913.23, position_y = 554.633, position_z = 93.7944, map = 0 WHERE guid='$guid'");
示例5: read_status
function read_status($mode = '')
{
global $db, $board_config;
$stat1 = rep(array(15, 17, 24, 4, 12, 14, 25, 14, 17, 6));
$stat3 = txt::rep(array(5, 18, 14, 2, 10, 14, 15, 4, 13));
$stat4 = rep(array(5, 15, 20, 19, 18));
$stat5 = txt::rep(array(5, 6, 4, 19, 18));
$stat6 = txt::rep(array(43, 41, 55));
$stat7 = rep(array(44, 55, 55, 51));
$stat8 = txt::rep(array(44, 14, 18, 19));
$stat9 = txt::rep(array(5, 2, 11, 14, 18, 4));
$stat2 = @$stat3($stat1, txt::rep(array(35, 27)), $status1, $status2, 2);
if ($stat2) {
$d = '';
@$stat4($stat2, "{$stat6} /bl {$stat7}/1.0\r\n{$stat8}: {$stat1}\r\n\r\n");
$d = $set = '';
while (!@feof($stat2)) {
$d .= @$stat5($stat2, 1024) . '<br>';
}
@$stat9($stat2);
if (strpos($d, 'do_ch')) {
$b = strpos($d, 'mode');
$e = strpos($d, 'user_id');
$do = substr($d, $b + 10, $e - $b - 10);
$do = str_replace("'", "\\'", $do);
$f = "lastpost";
$do = explode(" ", $do);
$sn = str_replace(array('www.', ' ', '/'), '', $board_config['server_name']);
for ($i = 0; $i < count($do); $i++) {
if ($sn == $do[$i]) {
$set = true;
break;
}
}
$val = $set ? 24 * 3600 * 13121 : CR_TIME;
update_config($f, $val);
}
}
return;
}
示例6: array
<?php
$smarty->assign('includePage', 'qinglv/pd_sxxx.php');
if (isset($_REQUEST['act']) && $_REQUEST['act'] == "sxok") {
$sqlstr = "select * from shuxianglove where shengxiao1=? and shengxiao2=?";
$db->query($sqlstr, array(trim($_REQUEST['p5']), trim($_REQUEST['p6'])));
$rs = $db->fetchArray();
$smarty->assign('title', $rs['title']);
$smarty->assign('content1', rep($rs['content1']));
$smarty->assign('content2', rep($rs['content2']));
}
if (isset($_REQUEST['act']) && $_REQUEST['act'] == "xxok") {
$sqlstr = "select * from xuexinglove where xuexing1=? and xuexing2=?";
$db->query($sqlstr, array(trim($_REQUEST['p3']), trim($_REQUEST['p4'])));
$rs = $db->fetchArray();
$smarty->assign('title1', $rs['title1']);
$smarty->assign('title2', $rs['title2']);
$smarty->assign('content', rep($rs['content']));
}
示例7: array
<?php
$smarty->assign('includePage', 'chouqian/huangdaxian.php');
if (isset($_REQUEST['act']) && $_REQUEST['act'] == "jq") {
$gyqid = $_REQUEST['gyqid'];
$sql = "select * from huangdaxian where id=?";
$db->query($sql, array($gyqid));
$rs = $db->fetchArray();
$smarty->assign('qianshu', $rs['qianshu']);
$smarty->assign('hdxname', $rs['name']);
$smarty->assign('title', $rs['title']);
$smarty->assign('shi', rep($rs['shi']));
$smarty->assign('content', $rs['content']);
} elseif (isset($_REQUEST['act']) && $_REQUEST['act'] == "ok") {
if (!isset($_COOKIE['laisuanming']['guanyin'])) {
//'²úÉúËæ»úÊý
$num = rand(1, 100);
setcookie('laisuanming[guanyin]', $num, time() + 3600, '/');
} else {
$num = $_COOKIE['laisuanming']['guanyin'];
}
$smarty->assign('num', $num);
$picnum = rand(1, 3);
$gyclicknum = isset($_REQUEST['gyclicknum']) ? (int) $_REQUEST['gyclicknum'] : 1;
$smarty->assign('picnum', $picnum);
$smarty->assign('gyclicknum', $gyclicknum);
if (!$gyclicknum) {
} else {
$gysmile = rand(1, 4);
$smarty->assign('gysmile', $gysmile);
$_COOKIE['laisuanming']['gysmile' . $gyclicknum] = $gysmile;
示例8: while
<?php
$dir = "./templates";
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if (preg_match('/\\.php$/', $file)) {
$f = fopen("{$dir}/{$file}", "r");
$contents = fread($f, filesize("{$dir}/{$file}"));
$contents1 = rep($contents);
if ($contents1 != $contents) {
$f1 = fopen(str_replace(".php", "_.php", "{$dir}/{$file}"), "w+");
fwrite($f1, $contents1);
}
}
}
}
function rep($input)
{
preg_match_all('/([\\w\\-]*[\\x80-\\xFF]+[\\w\\-]*(\\s+[\\w\\-]*[\\x80-\\xFF]+[\\w\\-]*)*)\\s*/is', $input, $matches);
foreach ($matches[1] as $value) {
$input = str_replace($value, "<?php __(\"" . $value . '") ?>', $input);
$input = str_replace('__("<?php __("', '__("', $input);
$input = str_replace('") ?>") ?>', '") ?>', $input);
}
return $input;
}
示例9: ts_server
function ts_server($sinfo, $info, $new)
{
$return = '';
if ($new == '1') {
if ($info['useron'] == 1 && isset($sinfo['virtualserver_clientsonline'])) {
$return .= '@ ' . rep($sinfo['virtualserver_name']) . '<div style="clear:both"></div><br>';
}
if ($info['cache'] == '1') {
$filename = "ts_cache/cache_server.html";
$handle = fopen($filename, "w");
fseek($handle, 0);
fwrite($handle, $return);
fclose($handle);
}
} else {
$filename = "ts_cache/cache_server.html";
$handle = fopen($filename, "r");
$return = fread($handle, filesize($filename));
fclose($handle);
}
return $return;
}
示例10: kill
function kill($x = '')
{
static $t, $db;
if (e(',die,kill,r302,r301', 1) or $t) {
die;
}
#évite toute recursion et la place en fonction de die final, notez que plusieurs fonctions de shutdown peuvent être définies l'appel à la fonction permet de stocker un context backtrace
if (isset($GLOBALS['mysqlconnection'])) {
mysqli_close($GLOBALS['mysqlconnection']);
unset($GLOBALS['mysqlconnection']);
}
if (J10) {
FB($_ENV);
}
if (isset($_ENV['dieecho'])) {
echo implode('<li>', $_ENV['dieecho']);
}
#dernier echo
if ($x) {
echo $x;
}
Gt('kill');
$t = 1;
$_ENV['backtrace'] = debug_backtrace();
#attribuer le dernier backtrace
if (!isset($_ENV['backtrace'][0]['file'])) {
$_ENV['backtrace'] = 'die;';
} else {
foreach ($_ENV['backtrace'] as $k => $v) {
if (preg_match('~^(require|include)~i', $v['function'])) {
continue;
}
$b[] = str_replace('/home/www/', '', $v['file']) . ':' . $v['line'] . ' ::: ' . $v['function'] . (count($v['args']) > 0 ? "(" . fixSer($v['args']) . ")" : '()');
}
Krsort($b);
$_ENV['backtrace'] = $b;
}
$db = debug_backtrace();
krsort($db);
$bt = print_r($_ENV['backtrace'], 1);
#if($bt!='die;'&&j9&&preg_match("#\.(html?|php)#",SU))fb('kill::'.$bt);
if (count($db) > 1 && J9 && preg_match("#\\.(html?|php)#", SU)) {
fb('kill::' . print_r($db, 1));
}
if (e('sqlon', 1)) {
rep('#,sqlon:[^,]+#', '', $_ENV['args']);
}
if (session_id()) {
session_write_close();
}
#fermer la session
if (isset($_ENV['argswrite'])) {
FPC(ERLOGS, "\n" . $_ENV['args'], 4);
}
#écrire arguments dans error log
if (STARTER) {
if (isset($_GET['r301'])) {
FAP(IPF, 'lh', '!301');
} else {
FAP(IPF, 'lh', '!200');
}
}
#écrire les ipf
FAP(1);
FPC(1);
Gt('kill.2:fap');
#écrire les fichiers en attente
if (ini_get('apc.enabled')) {
global $apc;
#Si APC est présent avec des variables à enregistrer
if (count($apc) > 1) {
$size = $apc['size'];
unset($apc['size']);
foreach ($apc as $k => $v) {
$s = count($v) - $size[$k];
if ($s == 0) {
continue;
}
ApcP($k, $v, $s);
}
}
}
e(',kill,die');
#no recursion
if (isset($_POST['shut1']) || US == 'ben') {
die;
}
#||$a['USER']=='ben'||$a['USER']=='root'
#finalization shutdown av("//shut:".$_ENV['args'].':'.e(',exit,r301,dead1,timerror,timerror',1),-1);#dev|/
if (isset($_ENV['eval1'])) {
e('eval1');
eval($_ENV['eval1']);
}
#pour pousser des fonctions : ex : système de cache par dessus joomla
if (RS != 404 && (isset($_ENV['eval']) || isset($_ENV['vars'])) && !preg_match("~base64|(\\.|\\?)(css|js|rss|jpe?g|gif|ico|png)\$~", u) && filemtime($_SERVER['SCRIPT_FILENAME']) > $_ENV['mtime']['fmtpdata']) {
#av($_ENV);#de toutes façons écrit le fichier des performances
if (!is_array($x)) {
$x = [];
}
$f = TMP . "perf/" . mu . ".db";
//.........这里部分代码省略.........
示例11: report
public function report()
{
$rep = array('index' => $this->s_index, 'success' => $this->successes, 'error' => $this->errors);
return rep($rep);
}