本文整理汇总了PHP中str::upper方法的典型用法代码示例。如果您正苦于以下问题:PHP str::upper方法的具体用法?PHP str::upper怎么用?PHP str::upper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类str
的用法示例。
在下文中一共展示了str::upper方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Gets a value from the _SERVER array
*
* <code>
*
* server::get('document_root');
* // sample output: /var/www/kirby
*
* server::get();
* // returns the whole server array
*
* </code>
*
* @param mixed $key The key to look for. Pass false or null to return the entire server array.
* @param mixed $default Optional default value, which should be returned if no element has been found
* @return mixed
*/
public static function get($key = false, $default = null)
{
if (empty($key)) {
return $_SERVER;
}
return a::get($_SERVER, str::upper($key), $default);
}
示例2: get
/**
* Gets a value from the _SERVER array
*
* <code>
*
* server::get('document_root');
* // sample output: /var/www/kirby
*
* server::get();
* // returns the whole server array
*
* </code>
*
* @param mixed $key The key to look for. Pass false or null to return the entire server array.
* @param mixed $default Optional default value, which should be returned if no element has been found
* @return mixed
*/
public static function get($key = false, $default = null)
{
if (empty($key)) {
return $_SERVER;
}
$key = str::upper($key);
$value = a::get($_SERVER, $key, $default);
return static::sanitize($key, $value);
}
示例3: getMonthBoard
public function getMonthBoard($month, $year)
{
// Calendar language
date_default_timezone_set('UTC');
$l = panel()->language();
setlocale(LC_ALL, $l . '_' . str::upper($l));
//setlocale(LC_ALL, 'us_US');
// Calendar stuff
$cal = new Calendarboard\calendar();
$currentMonth = $cal->month($year, $month);
return tpl::load(__DIR__ . DS . 'template.php', array('currentMonth' => $currentMonth, 'get_day_route_url' => purl($this->model(), 'field/' . $this->field()->name . '/calendarboard/get-day/'), 'calendarboard_url' => $this->model(), 'year_folder' => '/year-' . $year));
}
示例4: escapeJSChar
/**
* Escape character for JavaScript
*
* Callback function for preg_replace_callback() that applies Javascript
* escaping to all matches.
*
* @param array $matches
* @return string
*/
protected static function escapeJSChar($matches)
{
$char = $matches[0];
if (str::length($char) == 1) {
return sprintf('\\x%02X', ord($char));
}
$char = static::convertEncoding($char);
return sprintf('\\u%04s', str::upper(bin2hex($char)));
}
示例5: alphabetise
if (param('section')) {
$alphabetise = alphabetise($page->children()->filterBy('section', params('section'))->sortby('title'), array('key' => 'title'));
} else {
$alphabetise = alphabetise($page->children()->sortby('title'), array('key' => 'title'));
}
?>
<?php
foreach ($alphabetise as $letter => $items) {
?>
<h2 class="index" id="<?php
echo $letter;
?>
"><?php
echo str::upper($letter);
?>
</h2>
<ul class="<?php
echo $type;
?>
listing">
<?php
foreach ($items as $item) {
?>
<?php
if ($item->short_title()->isNotEmpty()) {
$title = $item->short_title();
} else {
$title = $item->title();
}
示例6: ucfirst
/**
* An UTF-8 safe version of ucfirst()
*
* @param string $string
* @return string
*/
static function ucfirst($str)
{
return str::upper(str::substr($str, 0, 1)) . str::substr($str, 1);
}
示例7: snippet
<!-- END HEADER -->
<!-- NAVBAR -->
<?php
snippet('navbar');
?>
<!-- END NAVBAR -->
<!-- MAIN -->
<div class="container">
<div class="row">
<!-- title -->
<div id="page-title" class="col-xs-12">
<h3><?php
echo str::upper($page->title()->html());
?>
</h3>
</div>
<!-- end title -->
<!-- intro -->
<div id="page-intro" class="col-xs-12">
<?php
echo $page->text();
?>
</div>
<!-- end intro -->
</div>
</div>
示例8: function
/**
* Converts the field value to lower case
* @param Field $field The calling Kirby Field instance
* @return Field
*/
field::$methods['lower'] = function ($field) {
$field->value = str::lower($field->value);
return $field;
};
/**
* Converts the field value to upper case
* @param Field $field The calling Kirby Field instance
* @return Field
*/
field::$methods['upper'] = function ($field) {
$field->value = str::upper($field->value);
return $field;
};
/**
* Applies the widont rule to avoid single
* words on the last line
* @param Field $field The calling Kirby Field instance
* @return Field
*/
field::$methods['widont'] = function ($field) {
$field->value = widont($field->value);
return $field;
};
/**
* Creates a simple text excerpt without formats
* @param Field $field The calling Kirby Field instance
示例9:
?>
<!-- END NAVBAR -->
<!-- MAIN -->
<div id="tests-page" class="container">
<div class="row">
<div class="col-xs-12">
<div class="row"
<!-- title -->
<div id="page-title" class="col-xs-12">
<h3><?php
echo str::upper($page->title());
?>
</h3>
</div>
<!-- end title -->
<?php
if ($tests) {
?>
<!-- take test intro -->
<div id="page-intro" class="col-xs-12">
<?php
echo $page->text()->kirbytext();
?>
</div>
示例10: testUpper
public function testUpper()
{
$this->assertEquals('SUPER ÄWESØME STRING', str::upper($this->sample));
}
示例11: format
public function format()
{
return str::upper($this->format);
}
示例12: format
public function format()
{
$format = str::upper($this->format);
return empty($format) ? 'YYYY-MM-DD' : $format;
}
示例13: foreach
?>
<select class="lang" onchange="window.location = this.value">
<?php
foreach (c::get('lang.available') as $lang) {
?>
<option value="<?php
echo languageToggle($lang);
?>
"<?php
if ($lang == c::get('lang.current')) {
echo ' selected="selected"';
}
?>
><?php
echo str::upper($lang);
?>
</option>
<?php
}
?>
</select>
<?php
}
?>
<?php
snippet('pages');
?>
</div>
示例14: gmdate
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//<?php
echo $site->url();
?>
//Kirby Calendar Plugin//<?php
echo str::upper($site->language()->code());
?>
METHOD:PUBLISH
<?php
foreach ($calendar->getAllEvents() as $event) {
?>
BEGIN:VEVENT
DTSTART:<?php
echo gmdate('Ymd\\THis\\Z', $event->getBeginTimestamp());
?>
DTEND:<?php
echo gmdate('Ymd\\THis\\Z', $event->getEndTimestamp());
?>
SUMMARY:<?php
echo $event->getField('summary');
?>
DESCRIPTION:<?php
echo $event->getField('description');
?>
LOCATION:<?php