本文整理汇总了PHP中lowercase函数的典型用法代码示例。如果您正苦于以下问题:PHP lowercase函数的具体用法?PHP lowercase怎么用?PHP lowercase使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lowercase函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: weekDayIndex
protected function weekDayIndex($day)
{
$day = lowercase($day);
if (!in_array($day, $this->validDays)) {
throw new \InvalidArgumentException("Provided day '{$day}' is not valid");
}
return $this->validDays[$day];
}
示例2: renderBlock
public function renderBlock($blockId)
{
$block = $this->blockProvider->getOneById($blockId);
if ($block && isset($block['type'])) {
$template = '@block_' . lowercase($block['type']) . '/view.twig';
// TODO: need to get other block params
return $this->twigEnvironment->render($template, array('block_id' => $blockId));
}
}
示例3: prepare_parentTitle
function prepare_parentTitle($page, $key)
{
if ($page['parent'] != '') {
$parentTitle = returnPageField($page['parent'], "title");
return lowercase($parentTitle . ' ' . $key);
} else {
return lowercase($key);
}
}
示例4: getKeywordsTitle
function getKeywordsTitle($document)
{
global $titlePattern;
global $titleSplitPattern;
global $dictionaryExclude;
$titleMatch = array();
if (preg_match($titlePattern, $document, $titleMatch) != 1) {
return null;
}
$keywords = preg_split($titleSplitPattern, $titleMatch[1], NULL, PREG_SPLIT_NO_EMPTY);
$keywords = lowercase($keywords);
$count = count($keywords);
for ($i = 0; $i < $count; $i++) {
if (in_array($keywords[$i], $dictionaryExclude)) {
unset($keywords[$i]);
}
}
return $keywords;
}
示例5: directoryToMultiArray
/**
* Return a directory of files and folders with heirarchy and additional data
*
* @since 3.1.3
*
* @param $directory string directory to scan
* @param $recursive boolean whether to do a recursive scan or not.
* @param $exts array file extension include filter, array of extensions to include
* @param $exclude bool true to treat exts as exclusion filter instead of include
* @return multidimensional array or files and folders {type,path,name}
*/
function directoryToMultiArray($dir, $recursive = true, $exts = null, $exclude = false)
{
// $recurse is not implemented
$result = array();
$dir = rtrim($dir, DIRECTORY_SEPARATOR);
$cdir = scandir($dir);
foreach ($cdir as $key => $value) {
if (!in_array($value, array(".", ".."))) {
if (is_dir($dir . DIRECTORY_SEPARATOR . $value)) {
$path = preg_replace("#\\\\|//#", "/", $dir . '/' . $value . '/');
$result[$value] = array();
$result[$value]['type'] = "directory";
$result[$value]['path'] = $path;
$result[$value]['dir'] = $value;
$result[$value]['value'] = call_user_func(__FUNCTION__, $path, $recursive, $exts, $exclude);
} else {
$path = preg_replace("#\\\\|//#", "/", $dir . '/');
// filetype filter
$ext = lowercase(pathinfo($value, PATHINFO_EXTENSION));
if (is_array($exts)) {
if (!in_array($ext, $exts) and !$exclude) {
continue;
}
if ($exclude and in_array($ext, $exts)) {
continue;
}
}
$result[$value] = array();
$result[$value]['type'] = 'file';
$result[$value]['path'] = $path;
$result[$value]['value'] = $value;
}
}
}
return $result;
}
示例6: _id
/**
* Clean ID
*
* Removes characters that don't work in URLs or IDs
*
* @param string $text
* @return string
*/
function _id($text)
{
$text = to7bit($text, "UTF-8");
$text = clean_url($text);
$text = preg_replace('/[[:cntrl:]]/', '', $text);
//remove control characters that cause interface to choke
return lowercase($text);
}
示例7: genStdThumb
function genStdThumb($path, $name)
{
if (!defined('GSIMAGEWIDTH')) {
$width = 200;
//New width of image
} else {
$width = GSIMAGEWIDTH;
}
$ext = lowercase(pathinfo($name, PATHINFO_EXTENSION));
if ($ext == 'jpg' || $ext == 'jpeg' || $ext == 'gif' || $ext == 'png') {
$thumbsPath = GSTHUMBNAILPATH . $path;
if (!file_exists($thumbsPath)) {
if (defined('GSCHMOD')) {
$chmod_value = GSCHMOD;
} else {
$chmod_value = 0755;
}
mkdir($thumbsPath, $chmod_value);
}
}
$targetFile = GSDATAUPLOADPATH . $path . $name;
//thumbnail for post
$imgsize = getimagesize($targetFile);
switch (lowercase(substr($targetFile, -3))) {
case "jpg":
$image = imagecreatefromjpeg($targetFile);
break;
case "png":
$image = imagecreatefrompng($targetFile);
break;
case "gif":
$image = imagecreatefromgif($targetFile);
break;
default:
exit;
break;
}
$height = $imgsize[1] / $imgsize[0] * $width;
//This maintains proportions
$src_w = $imgsize[0];
$src_h = $imgsize[1];
$picture = imagecreatetruecolor($width, $height);
imagealphablending($picture, false);
imagesavealpha($picture, true);
$bool = imagecopyresampled($picture, $image, 0, 0, 0, 0, $width, $height, $src_w, $src_h);
if ($bool) {
$thumbnailFile = $thumbsPath . "thumbnail." . $name;
switch (lowercase(substr($targetFile, -3))) {
case "jpg":
$bool2 = imagejpeg($picture, $thumbnailFile, 85);
break;
case "png":
imagepng($picture, $thumbnailFile);
break;
case "gif":
imagegif($picture, $thumbnailFile);
break;
}
}
imagedestroy($picture);
imagedestroy($image);
}
示例8: clean_title
function clean_title($d)
{
$nb = " ";
$d = htmlentities($d);
$d = html_entity_decode_b($d);
$d = html_entity_decode($d);
//$d=clean_acc($d);
//$d=utflatindecode($d);
$d = clean_punct_b($d);
$d = lowercase($d);
if (substr($d, -1) == '"') {
$d = substr($d, 0, -1) . $nb . '»';
}
if (substr($d, 0, 1) == '"') {
$d = '«' . $nb . substr($d, 1);
}
$d = str_replace(' "', ' «' . $nb, $d);
$d = str_replace(array('" ', '"'), $nb . '» ', $d);
$d = ereg_replace("[ ]{2,}", ' ', $d);
//$d=clean_punct($d);//add clean_acc
//$d=unescape($d);
return trim($d);
}
示例9: imagedestroy
imagedestroy($picture);
imagedestroy($image);
//small thumbnail for image preview
$width = 65;
//New width of image
$height = $imgsize[1] / $imgsize[0] * $width;
//This maintains proportions
$src_w = $imgsize[0];
$src_h = $imgsize[1];
$picture = imagecreatetruecolor($width, $height);
imagealphablending($picture, false);
imagesavealpha($picture, true);
$bool = imagecopyresampled($picture, $image, 0, 0, 0, 0, $width, $height, $src_w, $src_h);
if ($bool) {
$thumbsmFile = $thumbsPath . "thumbsm." . $name;
switch (lowercase(substr($targetFile, -3))) {
case "jpg":
header("Content-Type: image/jpeg");
$bool2 = imagejpeg($picture, $thumbsmFile, 85);
break;
case "png":
header("Content-Type: image/png");
imagepng($picture, $thumbsmFile);
break;
case "gif":
header("Content-Type: image/gif");
imagegif($picture, $thumbsmFile);
break;
}
}
imagedestroy($picture);
示例10: get_FileType
/**
* File Type Category
*
* Returns the category of an file based on it's extension
*
* @since 1.0
* @uses i18n_r
*
* @param string $ext
* @return string
*/
function get_FileType($ext)
{
$ext = lowercase($ext);
if ($ext == 'jpg' || $ext == 'jpeg' || $ext == 'pct' || $ext == 'gif' || $ext == 'bmp' || $ext == 'png') {
return i18n_r('IMAGES') . ' Images';
} elseif ($ext == 'zip' || $ext == 'gz' || $ext == 'rar' || $ext == 'tar' || $ext == 'z' || $ext == '7z' || $ext == 'pkg') {
return i18n_r('FTYPE_COMPRESSED');
} elseif ($ext == 'ai' || $ext == 'psd' || $ext == 'eps' || $ext == 'dwg' || $ext == 'tif' || $ext == 'tiff' || $ext == 'svg') {
return i18n_r('FTYPE_VECTOR');
} elseif ($ext == 'swf' || $ext == 'fla') {
return i18n_r('FTYPE_FLASH');
} elseif ($ext == 'mov' || $ext == 'mpg' || $ext == 'avi' || $ext == 'mpeg' || $ext == 'rm' || $ext == 'wmv') {
return i18n_r('FTYPE_VIDEO');
} elseif ($ext == 'mp3' || $ext == 'wav' || $ext == 'wma' || $ext == 'midi' || $ext == 'mid' || $ext == 'm3u' || $ext == 'ra' || $ext == 'aif') {
return i18n_r('FTYPE_AUDIO');
} elseif ($ext == 'php' || $ext == 'phps' || $ext == 'asp' || $ext == 'xml' || $ext == 'js' || $ext == 'jsp' || $ext == 'sql' || $ext == 'css' || $ext == 'htm' || $ext == 'html' || $ext == 'xhtml' || $ext == 'shtml') {
return i18n_r('FTYPE_WEB');
} elseif ($ext == 'mdb' || $ext == 'accdb' || $ext == 'pdf' || $ext == 'xls' || $ext == 'xlsx' || $ext == 'csv' || $ext == 'tsv' || $ext == 'ppt' || $ext == 'pps' || $ext == 'pptx' || $ext == 'txt' || $ext == 'log' || $ext == 'dat' || $ext == 'text' || $ext == 'doc' || $ext == 'docx' || $ext == 'rtf' || $ext == 'wks') {
return i18n_r('FTYPE_DOCUMENTS');
} elseif ($ext == 'exe' || $ext == 'msi' || $ext == 'bat' || $ext == 'download' || $ext == 'dll' || $ext == 'ini' || $ext == 'cab' || $ext == 'cfg' || $ext == 'reg' || $ext == 'cmd' || $ext == 'sys') {
return i18n_r('FTYPE_SYSTEM');
} else {
return i18n_r('FTYPE_MISC');
}
}
示例11: bm_admin_panel
function bm_admin_panel()
{
global $PRETTYURLS, $BMPRETTYURLS;
$books = bm_get_books(true);
?>
<h3 class="floated"><?php
i18n('books_manager/PLUGIN_NAME');
?>
</h3>
<div class="edit-nav clearfix">
<a href="#" id="filter-button" ><?php
i18n('FILTER');
?>
</a>
<a href="load.php?id=books_manager&edit"><?php
i18n('books_manager/NEW_BOOK');
?>
</a>
<a href="load.php?id=books_manager&settings"><?php
i18n('books_manager/SETTINGS');
?>
</a>
</div>
<?php
if (!empty($books)) {
?>
<div id="filter-search">
<form>
<input type="text" class="text" id="tokens" placeholder="<?php
echo lowercase(i18n_r('FILTER'));
?>
..." />
<a href="load.php?id=books_manager" class="cancel"><?php
i18n('books_manager/CANCEL');
?>
</a>
</form>
</div>
<table id="books" class="highlight">
<tr>
<th><?php
i18n('books_manager/BOOK_TITLE');
?>
</th>
<th style="text-align: right;"><?php
i18n('books_manager/DATE');
?>
</th>
<th></th>
<th></th>
<th></th>
</tr>
<?php
foreach ($books as $book) {
$title = cl($book->title);
$date = shtDate($book->date);
$url = bm_get_url('book') . $book->slug;
?>
<tr>
<td class="booktitle">
<a href="load.php?id=books_manager&edit=<?php
echo $book->slug;
?>
" title="<?php
i18n('books_manager/EDIT_BOOK');
?>
: <?php
echo $title;
?>
">
<?php
echo $title;
?>
</a>
</td>
<td style="text-align: right;">
<span><?php
echo $date;
?>
</span>
</td>
<td style="width: 20px;text-align: center;">
<?php
if ($book->private == 'Y') {
echo '<span style="color: #aaa;">P</span>';
}
?>
</td>
<td class="secondarylink">
<a href="<?php
echo $url;
?>
//.........这里部分代码省略.........
示例12: nm_lowercase_tags
function nm_lowercase_tags($str)
{
if (defined('NMLOWERCASETAGS') && NMLOWERCASETAGS) {
return lowercase($str);
} else {
return $str;
}
}
示例13: i18n_r
<?php
if (!$log_data) {
echo '<p><em>' . i18n_r('LOG_FILE_EMPTY') . '</em></p>';
}
?>
<ol class="more" >
<?php
$count = 1;
if ($log_data) {
foreach ($log_data as $log) {
echo '<li><p style="font-size:11px;line-height:15px;" ><b style="line-height:20px;" >' . i18n_r('LOG_FILE_ENTRY') . '</b><br />';
foreach ($log->children() as $child) {
$name = $child->getName();
echo '<b>' . stripslashes(ucwords($name)) . '</b>: ';
$d = $log->{$name};
$n = lowercase($child->getName());
$ip_regex = '/^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.](?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$/';
$url_regex = @"((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\\w\\d:#@%/;\$()~_?\\+-=\\\\.&]*)";
//check if its an url address
if (do_reg($d, $url_regex)) {
$d = '<a href="' . $d . '" target="_blank" >' . $d . '</a>';
}
//check if its an ip address
if (do_reg($d, $ip_regex)) {
if ($d == $_SERVER['REMOTE_ADDR']) {
$d = i18n_r('THIS_COMPUTER') . ' (<a href="' . $whois_url . $d . '" target="_blank" >' . $d . '</a>)';
} else {
$d = '<a href="' . $whois_url . $d . '" target="_blank" >' . $d . '</a>';
}
}
//check if its an email address
示例14: editor_array2ul
/**
* outputs a ul nested tree from directory array
* @param array $array directoryToMultiArray()
* @param boolean $hideEmpty omit empty directories if true
* @return string
*/
function editor_array2ul($array, $hideEmpty = true, $recurse = true)
{
global $allowed_extensions, $template_file, $template;
$cnt = 0;
$out = "<ul>";
foreach ($array as $key => $elem) {
if (!is_array($elem['value'])) {
// Is a file
$ext = lowercase(pathinfo($elem['value'], PATHINFO_EXTENSION));
if (in_array($ext, $allowed_extensions)) {
$filename = $elem['value'];
$filepath = $elem['path'];
$filenamefull = substr(strstr($filepath . $filename, getRelPath(GSTHEMESPATH) . $template . '/'), strlen(getRelPath(GSTHEMESPATH) . $template . '/'));
$open = editor_fileIsOpen($elem['path'], $elem['value']) ? ' open' : '';
if ($filename == GSTEMPLATEFILE) {
$ext = 'theme';
$filename = i18n_r('DEFAULT_TEMPLATE');
}
$link = myself(false) . '?t=' . $template . '&f=' . $filenamefull;
$out .= '<li><a href="' . $link . '"class="file ext-' . $ext . $open . '">' . $filename . "</a></li>";
}
} else {
if ($recurse) {
// Is a folder
// Are we showing/hiding empty folders.
// WILL NOT hide empty folders that contain at least 1 subfolder
$empty = '';
if (count($elem['value']) == 0) {
if ($hideEmpty) {
continue;
}
$empty = ' dir-empty';
// empty folder class
}
$out .= '<li><a class="directory' . $empty . '">' . $key . '</a>' . editor_array2ul($elem['value']) . '</li>';
}
}
}
$out = $out . "</ul>";
return $out;
}
示例15: lowercase
<html>
<?php
if (isset($_GET['sentence'])) {
$string = $_GET['sentence'];
$result = lowercase($string);
echo $result;
}
function lowercase($string)
{
$length = strlen($string);
$low = " ";
for ($i = 0; $i < $length; $i++) {
if (ord($string[$i]) >= ord('A') && ord($string[$i]) <= ord('Z')) {
$str = chr(ord($string[$i]) + ord('a') - ord('A'));
} else {
$str = $string[$i];
}
$low .= $str;
}
return $low;
}
?>
<body>
<form action = "lowercasefunction.php" method="get">
Given string:<input type="text" name="sentence"/>
<br>
<button type="submit">click here</button>
</form>
</body>