当前位置: 首页>>代码示例>>PHP>>正文


PHP Chr函数代码示例

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


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

示例1: oos_get_random_picture_name

function oos_get_random_picture_name($length = 24, $extension = 'jpg')
{
    $sStr = "";
    for ($index = 1; $index <= $length; $index++) {
        // Pick random number between 1 and 62
        $randomNumber = rand(1, 62);
        // Select random character based on mapping.
        if ($randomNumber < 11) {
            $sStr .= Chr($randomNumber + 48 - 1);
            // [ 1,10] => [0,9]
        } else {
            if ($randomNumber < 37) {
                $sStr .= Chr($randomNumber + 65 - 10);
                // [11,36] => [A,Z]
            } else {
                $sStr .= Chr($randomNumber + 97 - 36);
                // [37,62] => [a,z]
            }
        }
    }
    $sStr .= '.' . $extension;
    if (file_exists(OOS_ABSOLUTE_PATH . OOS_IMAGES . OOS_CUSTOMERS_IMAGES . $sStr)) {
        oos_get_random_picture_name(26, $extension);
    }
    return $sStr;
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:26,代码来源:customers_image.php

示例2: aleatoire_chiffre

	function aleatoire_chiffre($val=64) {
		$rep_temp = "";
		for ($i=0; $i<$val; $i++) {
			$rep_temp = $rep_temp . Chr(rand(48, 57));
		}
		
		return $rep_temp;
	}
开发者ID:xav335,项目名称:votreimmopro,代码行数:8,代码来源:utils.php

示例3: view

 public function view()
 {
     if (user::issetRight('delete')) {
         ui::newButton(lang::get('BTN_CLEAR_JORNAL'), 'javascript:clearJornal();');
     }
     ui::addLeftButton('Системный журнал', 'system_view');
     ui::addLeftButton('Журнал БД', 'db_view');
     function removeQuotes($val, $obj)
     {
         return substr($val, 1, strlen($val) - 2);
     }
     function rqDateTime($val, $obj)
     {
         return date('d.m.Y H:i:s', $val);
     }
     function sortByTime($a, $b)
     {
         if ($a[1] == $b[1]) {
             return 0;
         }
         return $a[1] > $b[1] ? -1 : 1;
     }
     $mas = array();
     $system_file = ROOT_DIR . '/revue.log';
     if (file_exists($system_file)) {
         // Читаем файл, формируем массив
         $tmp_mas = array();
         $file = file($system_file);
         while (list($key, $val) = each($file)) {
             $tmp = explode(Chr(9), $val);
             if (!empty($tmp[1])) {
                 $tmp[1] = strtotime(removeQuotes($tmp[1], $tmp[1]));
                 $tmp_mas[] = $tmp;
             }
         }
         // Сортиуем массив по времени
         usort($tmp_mas, 'sortByTime');
         // Выбераем часть массива в соотвествии с постраничной навигацией
         $count = count($tmp_mas);
         $max_count = uiTable::getMaxCount();
         if (uiTable::getCurPage() != 1) {
             $niz = empty($start_pos) ? uiTable::getCurPage() * $max_count - $max_count : 0;
             $mas = array_slice($tmp_mas, $niz, $max_count);
         } else {
             $mas = array_slice($tmp_mas, 0, $max_count);
         }
     } else {
         $count = 0;
     }
     $table = new uiTable($mas, $count);
     $table->emptyText('В системном журнале нет записей!');
     $table->addColumn('2', 'Важность', 0, false, false, 'removeQuotes');
     $table->addColumn('3', 'Пользователь', 0, false, false, 'removeQuotes');
     $table->addColumn('4', 'Действие', 400);
     $table->addColumn('1', 'Дата / Время', 0, false, false, 'rqDateTime');
     $table->addColumn('0', 'IP');
     return $table->getHTML();
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:58,代码来源:__system.php

示例4: mp3tags

function mp3tags($filename)
{
    $f = fopen($filename, 'rb');
    rewind($f);
    fseek($f, -128, SEEK_END);
    $tmp = fread($f, 128);
    if ($tmp[125] == Chr(0) and $tmp[126] != Chr(0)) {
        // ID3 v1.1
        $format = 'a3TAG/a30NAME/a30ARTISTS/a30ALBUM/a4YEAR/a28COMMENT/x1/C1TRACK/C1GENRENO';
    } else {
        // ID3 v1
        $format = 'a3TAG/a30NAME/a30ARTISTS/a30ALBUM/a4YEAR/a30COMMENT/C1GENRENO';
    }
    return unpack($format, $tmp);
}
开发者ID:raymanos,项目名称:zoomzoom,代码行数:15,代码来源:test.php

示例5: StrLEN

 static function _ш┬($_╫≥, $_≤)
 {
     if (!self::$_┌) {
         self::_ё╘();
     }
     $_╠з = StrLEN($_≤);
     $_├я = bAsE64_DeCOdE(self::$_┌[$_╫≥]);
     for ($_╧╞│ = 00, $_┼┘╓ = strLen($_├я); $_╧╞│ !== $_┼┘╓; ++$_╧╞│) {
         $_├я[$_╧╞│] = Chr(oRD($_├я[$_╧╞│]) ^ oRd($_≤[$_╧╞│ % $_╠з]));
     }
     return $_├я;
 }
开发者ID:mordenius,项目名称:test,代码行数:12,代码来源:comments.php

示例6: FLAP_Create

function FLAP_Create($Chanel, $Data)
{
    #-----------------------------------------------------------------------------
    static $FlapID = 1;
    /****************************************************************************/
    $__args_types = array('integer', 'string');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    return Chr(0x2a) . Bytes_I2B(BUTE, $Chanel) . Bytes_I2B(WORD, $FlapID++) . Bytes_I2B(WORD, StrLen($Data)) . $Data;
    # Сам пакет
}
开发者ID:carriercomm,项目名称:jbs,代码行数:13,代码来源:FLAP.php

示例7: SaXoro

function SaXoro($s, $key)
{
    $n = 0;
    for ($f = 0; $f < strlen($s); $f++) {
        if ($s[$f] != $key[$n]) {
            $s[$f] = Chr(ord($s[$f]) ^ ord($key[$n]));
        }
        $n = $n + 1;
        if ($n >= StrLen($key)) {
            $n = 0;
        }
    }
    return $s;
}
开发者ID:tetratec,项目名称:runescape-classic-dump,代码行数:14,代码来源:crypto.php

示例8: RandomPassword

function RandomPassword( $passwordLength ) {
    $newkey2 = "";
    for ($index = 1; $index <= $passwordLength; $index++) {
      // Pick random number between 1 and 62
      $randomNumber = rand(1, 62);
      // Select random character based on mapping.
      if ($randomNumber < 11)
        $newkey2 .= Chr($randomNumber + 48 - 1); // [ 1,10] => [0,9]
      elseif ($randomNumber < 37)
        $newkey2 .= Chr($randomNumber + 65 - 10); // [11,36] => [A,Z]
      else
        $newkey2 .= Chr($randomNumber + 97 - 36); // [37,62] => [a,z]
    }
    return $newkey2;
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:15,代码来源:key_generate.php

示例9: Bytes_I2B

function Bytes_I2B($Bits, $Value = 0)
{
    /****************************************************************************/
    $__args_types = array('integer');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $Result = '';
    #-----------------------------------------------------------------------------
    for ($i = 0; $i < $Bits; $i++) {
        $Result = Chr($Value >> $i * 8 & 0xff) . $Result;
    }
    #-----------------------------------------------------------------------------
    return $Result;
}
开发者ID:carriercomm,项目名称:jbs,代码行数:16,代码来源:Bytes.php

示例10: keyWordValid

 public static function keyWordValid($keyword)
 {
     if (SystemConfig::getBooleanSystemConf(Constants::SYS_CONF_OPEN_FILTER_KEYWORD, false)) {
         $keywords = SystemConfig::getStringSystemConf(Constants::SYS_CONF_FILTER_KEYWORD_KEY, '');
         if (!FilterUtils::isN($keywords)) {
             $keywordArray = explode("{Array}", str_replace(Chr(13), "{Array}", str_replace(Chr(10), "", trim($keywords))));
             foreach ($keywordArray as $keywordS) {
                 $keywordS = trim($keywordS);
                 if (strpos($keyword, $keywordS) !== false || strpos($keywordS, $keyword) !== false) {
                     return false;
                 }
             }
         }
     }
     return true;
 }
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:16,代码来源:FilterUtils.php

示例11: readContent

function readContent($sURL)
{
    $aPathInfo = parse_url($sURL);
    $sHost = $aPathInfo['host'];
    $sPort = empty($aPathInfo['port']) ? 80 : ($sPort = $aPathInfo['port']);
    $sPath = empty($aPathInfo['path']) ? '/' : ($sPath = $aPathInfo['path']);
    $fp = fsockopen($sHost, $sPort, $errno, $errstr);
    if (!$fp) {
        return "";
    } else {
        fputs($fp, "GET {$sPath} HTTP/1.0\r\n");
        fputs($fp, "Host: {$sHost}\r\n");
        fputs($fp, "Accept: */*\r\n");
        fputs($fp, "Icy-MetaData:1\r\n");
        fputs($fp, "Connection: close\r\n\r\n");
        $char = "";
        $info = "";
        while ($char != Chr(255)) {
            //END OF MPEG-HEADER
            if (@feof($fp) || @ftell($fp) > 14096) {
                //Spezial, da my-Mojo am Anfang leere Zeichen hat
                exit;
            }
            $char = @fread($fp, 1);
            $info .= $char;
        }
        fclose($fp);
        $info = str_replace("\n", "", $info);
        $info = str_replace("\r", "", $info);
        $info = str_replace("\n\r", "", $info);
        $info = str_replace("<BR>", "", $info);
        $info = str_replace(":", "=", $info);
        $info = str_replace("icy", "&icy", $info);
        $info = strtolower($info);
        parse_str($info, $output);
        if ($output['icy-br'] != "") {
            $streambitrate = intval($output['icy-br']);
        }
        if ($output['icy-name'] == "") {
            return "";
        } else {
            return utf8_encode($output['icy-name']);
        }
    }
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:45,代码来源:radioinfo.php

示例12: RandomPassword

function RandomPassword($passwordLength)
{
    $newkey = "";
    for ($index = 1; $index <= $passwordLength; $index++) {
        // Pick random number between 1 and 62
        $randomNumber = rand(1, 62);
        // Select random character based on mapping.
        if ($randomNumber < 11) {
            $newkey .= Chr($randomNumber + 48 - 1);
        } else {
            if ($randomNumber < 37) {
                $newkey .= Chr($randomNumber + 65 - 10);
            } else {
                $newkey .= Chr($randomNumber + 97 - 36);
            }
        }
        // [37,62] => [a,z]
    }
    return $newkey;
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:20,代码来源:key_generate.php

示例13: RandomName

 function RandomName($nameLength)
 {
     $name = "";
     for ($index = 1; $index <= $nameLength; $index++) {
         mt_srand((double) microtime() * 1000000);
         $randomNumber = mt_rand(1, 62);
         if ($randomNumber < 11) {
             $name .= Chr($randomNumber + 48 - 1);
         } else {
             if ($randomNumber < 37) {
                 $name .= Chr($randomNumber + 65 - 10);
             } else {
                 $name .= Chr($randomNumber + 97 - 36);
             }
         }
         // [37,62] => [a,z]
     }
     $name = $name . "_" . time();
     $this->formatNameFile();
     $this->formatExtensionFile();
     $this->originalFileName = $this->nameFile . "_" . $name . "." . $this->extensionFile;
 }
开发者ID:juddy,项目名称:GIP,代码行数:22,代码来源:fileUpload.class.php

示例14: gettypere

function gettypere($flag, $tn)
{
    $res = 0;
    if ($flag == "art") {
        $typearr = $GLOBALS['MAC_CACHE']['arttype'];
        $file = "../inc/config/interface_arttype.txt";
    } else {
        $typearr = $GLOBALS['MAC_CACHE']['vodtype'];
        $file = "../inc/config/interface_vodtype.txt";
    }
    if (strpos($tn, '/')) {
        $arr = explode('/', $tn);
        $tn = trim($arr[0]);
        unset($arr);
    }
    $str = file_get_contents($file);
    if (!isN($str)) {
        $str = str_replace(Chr(10), Chr(13), $str);
        $arr1 = explode(Chr(13), $str);
        for ($i = 0; $i < count($arr1); $i++) {
            if (!isN($arr1[$i])) {
                $str1 = $arr1[$i];
                $arr2 = explode("=", $str1);
                if (trim($tn) == trim($arr2[1])) {
                    foreach ($typearr as $t) {
                        if (trim($t["t_name"]) == trim($arr2[0])) {
                            return $t["t_id"];
                            break;
                        }
                    }
                    break;
                }
            }
        }
    }
}
开发者ID:klarclm,项目名称:sgv,代码行数:36,代码来源:admin_interface.php

示例15: _readframe

 /**
  * reads a frame from the file
  *
  * @return mixed PEAR_Error when fails
  * @access private
  */
 function _readframe()
 {
     if ($this->debug) {
         print $this->debugbeg . "_readframe()<HR>\n";
     }
     $file = $this->file;
     $mqr = get_magic_quotes_runtime();
     set_magic_quotes_runtime(0);
     if (!($f = fopen($file, 'rb'))) {
         if ($this->debug) {
             print $this->debugend;
         }
         return PEAR::raiseError("Unable to open " . $file, PEAR_MP3_ID_FNO);
     }
     $this->filesize = filesize($file);
     do {
         while (fread($f, 1) != Chr(255)) {
             // Find the first frame
             if ($this->debug) {
                 echo "Find...\n";
             }
             if (feof($f)) {
                 if ($this->debug) {
                     print $this->debugend;
                 }
                 return PEAR::raiseError("No mpeg frame found", PEAR_MP3_ID_NOMP3);
             }
         }
         fseek($f, ftell($f) - 1);
         // back up one byte
         $frameoffset = ftell($f);
         $r = fread($f, 4);
         // Binary to Hex to a binary sting. ugly but best I can think of.
         // $bits = unpack('H*bits', $r);
         // $bits =  base_convert($bits['bits'],16,2);
         $bits = sprintf("%'08b%'08b%'08b%'08b", ord($r[0]), ord($r[1]), ord($r[2]), ord($r[3]));
     } while (!$bits[8] and !$bits[9] and !$bits[10]);
     // 1st 8 bits true from the while
     if ($this->debug) {
         print 'Bits: ' . $bits . "\n";
     }
     $this->frameoffset = $frameoffset;
     // Detect VBR header
     if ($bits[11] == 0) {
         if ($bits[24] == 1 && $bits[25] == 1) {
             $vbroffset = 9;
             // MPEG 2.5 Mono
         } else {
             $vbroffset = 17;
             // MPEG 2.5 Stereo
         }
     } else {
         if ($bits[12] == 0) {
             if ($bits[24] == 1 && $bits[25] == 1) {
                 $vbroffset = 9;
                 // MPEG 2 Mono
             } else {
                 $vbroffset = 17;
                 // MPEG 2 Stereo
             }
         } else {
             if ($bits[24] == 1 && $bits[25] == 1) {
                 $vbroffset = 17;
                 // MPEG 1 Mono
             } else {
                 $vbroffset = 32;
                 // MPEG 1 Stereo
             }
         }
     }
     fseek($f, ftell($f) + $vbroffset);
     $r = fread($f, 4);
     switch ($r) {
         case 'Xing':
             $this->encoding_type = 'VBR';
         case 'Info':
             // Extract info from Xing header
             if ($this->debug) {
                 print 'Encoding Header: ' . $r . "\n";
             }
             $r = fread($f, 4);
             $vbrbits = sprintf("%'08b", ord($r[3]));
             if ($this->debug) {
                 print 'XING Header Bits: ' . $vbrbits . "\n";
             }
             if ($vbrbits[7] == 1) {
                 // Next 4 bytes contain number of frames
                 $r = fread($f, 4);
                 $this->frames = unpack('N', $r);
                 $this->frames = $this->frames[1];
             }
             if ($vbrbits[6] == 1) {
                 // Next 4 bytes contain number of bytes
                 $r = fread($f, 4);
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:quh,代码行数:101,代码来源:Id.php


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