本文整理汇总了PHP中strtolower函数的典型用法代码示例。如果您正苦于以下问题:PHP strtolower函数的具体用法?PHP strtolower怎么用?PHP strtolower使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了strtolower函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: generateRoute
/**
* Add all the routes in the router in parameter
* @param $router Router
*/
public function generateRoute(Router $router)
{
foreach ($this->classes as $class) {
$classMethods = get_class_methods($this->namespace . $class . 'Controller');
$rc = new \ReflectionClass($this->namespace . $class . 'Controller');
$parent = $rc->getParentClass();
$parent = get_class_methods($parent->name);
$className = $this->namespace . $class . 'Controller';
foreach ($classMethods as $methodName) {
if (in_array($methodName, $parent) || $methodName == 'index') {
continue;
} else {
foreach (Router::getSupportedHttpMethods() as $httpMethod) {
if (strstr($methodName, $httpMethod)) {
continue 2;
}
if (in_array($methodName . $httpMethod, $classMethods)) {
$router->add('/' . strtolower($class) . '/' . $methodName, new $className(), $methodName . $httpMethod, $httpMethod);
unset($classMethods[$methodName . $httpMethod]);
}
}
$router->add('/' . strtolower($class) . '/' . $methodName, new $className(), $methodName);
}
}
$router->add('/' . strtolower($class), new $className(), 'index');
}
}
开发者ID:kazuohirai,项目名称:awayfromswag,代码行数:31,代码来源:ClassRouting.php
示例2: openseadragon
/**
* Return a OpenSeadragon image viewer for the provided files.
*
* @param File|array $files A File record or an array of File records.
* @param int $width The width of the image viewer in pixels.
* @param int $height The height of the image viewer in pixels.
* @return string|null
*/
public function openseadragon($files)
{
if (!is_array($files)) {
$files = array($files);
}
// Filter out invalid images.
$images = array();
$imageNames = array();
foreach ($files as $file) {
// A valid image must be a File record.
if (!$file instanceof File) {
continue;
}
// A valid image must have a supported extension.
$extension = pathinfo($file->original_filename, PATHINFO_EXTENSION);
if (!in_array(strtolower($extension), $this->_supportedExtensions)) {
continue;
}
$images[] = $file;
$imageNames[explode(".", $file->filename)[0]] = openseadragon_dimensions($file, 'original');
}
// Return if there are no valid images.
if (!$images) {
return;
}
return $this->view->partial('common/openseadragon.php', array('images' => $images, 'imageNames' => $imageNames));
}
开发者ID:UVicLibrary,项目名称:omeka-OpenSeadragon2,代码行数:35,代码来源:Openseadragon.php
示例3: addnew
function addnew()
{
if ($_POST) {
$image = $_FILES['logo'];
$image_name = $image['name'];
$image_tmp = $image['tmp_name'];
$image_size = $image['size'];
$error = $image['error'];
$file_ext = explode('.', $image_name);
$file_ext = strtolower(end($file_ext));
$allowed_ext = array('jpg', 'jpeg', 'bmp', 'png', 'gif');
$file_on_server = '';
if (in_array($file_ext, $allowed_ext)) {
if ($error === 0) {
if ($image_size < 3145728) {
$file_on_server = uniqid() . '.' . $file_ext;
$destination = './brand_img/' . $file_on_server;
move_uploaded_file($image_tmp, $destination);
}
}
}
$values = array('name' => $this->input->post('name'), 'description' => $this->input->post('desc'), 'logo' => $file_on_server, 'is_active' => 1);
if ($this->brand->create($values)) {
$this->session->set_flashdata('message', 'New Brand added successfully');
} else {
$this->session->set_flashdata('errormessage', 'Oops! Something went wrong!!');
}
redirect(base_url() . 'brands/');
}
$this->load->helper('form');
$this->load->view('includes/header', array('title' => 'Add Brand'));
$this->load->view('brand/new_brand');
$this->load->view('includes/footer');
}
开发者ID:PHP-web-artisans,项目名称:ustora_backend,代码行数:34,代码来源:brands.php
示例4: getLinkDefsInFieldMeta
/**
* Get link definition defined in 'fields' metadata. In linkDefs can be used as value (e.g. "type": "hasChildren") and/or variables (e.g. "entityName":"{entity}"). Variables should be defined into fieldDefs (in 'entityDefs' metadata).
*
* @param string $entityName
* @param array $fieldDef
* @param array $linkFieldDefsByType
* @return array | null
*/
public function getLinkDefsInFieldMeta($entityName, $fieldDef, array $linkFieldDefsByType = null)
{
if (!isset($fieldDefsByType)) {
$fieldDefsByType = $this->getFieldDefsByType($fieldDef);
if (!isset($fieldDefsByType['linkDefs'])) {
return null;
}
$linkFieldDefsByType = $fieldDefsByType['linkDefs'];
}
foreach ($linkFieldDefsByType as $paramName => &$paramValue) {
if (preg_match('/{(.*?)}/', $paramValue, $matches)) {
if (in_array($matches[1], array_keys($fieldDef))) {
$value = $fieldDef[$matches[1]];
} else {
if (strtolower($matches[1]) == 'entity') {
$value = $entityName;
}
}
if (isset($value)) {
$paramValue = str_replace('{' . $matches[1] . '}', $value, $paramValue);
}
}
}
return $linkFieldDefsByType;
}
开发者ID:chinazan,项目名称:zzcrm,代码行数:33,代码来源:Helper.php
示例5: calculateGFRResult
function calculateGFRResult()
{
$tmpArr = array();
$tmpArr[] = date('Y-m-d H:i:s');
//observation time
$tmpArr[] = 'GFR (CALC)';
//desc
$gender = NSDR::populate($this->_patientId . "::com.clearhealth.person.displayGender");
$crea = NSDR::populate($this->_patientId . "::com.clearhealth.labResults[populate(@description=CREA)]");
$genderFactor = null;
$creaValue = null;
$personAge = null;
$raceFactor = 1;
switch ($gender[key($gender)]) {
case 'M':
$genderFactor = 1;
break;
case 'F':
$genderFactor = 0.742;
break;
}
if ((int) strtotime($crea['observation_time']) >= strtotime('now - 60 days') && strtolower($crea[key($crea)]['units']) == 'mg/dl') {
$creaValue = $crea[key($crea)]['value'];
}
$person = new Person();
$person->personId = $this->_patientId;
$person->populate();
if ($person->age > 0) {
$personAge = $person->age;
}
$personStat = new PatientStatistics();
$personStat->personId = $this->_patientId;
$personStat->populate();
if ($personStat->race == "AFAM") {
$raceFactor = 1.21;
}
$gfrValue = "INC";
if ($personAge > 0 && $creaValue > 0) {
$gfrValue = "" . (int) round(pow($creaValue, -1.154) * pow($personAge, -0.203) * $genderFactor * $raceFactor * 186);
}
trigger_error("gfr:: " . $gfrValue, E_USER_NOTICE);
$tmpArr[] = $gfrValue;
// lab value
$tmpArr[] = 'mL/min/1.73 m2';
//units
$tmpArr[] = '';
//ref range
$tmpArr[] = '';
//abnormal
$tmpArr[] = 'F';
//status
$tmpArr[] = date('Y-m-d H:i:s') . '::' . '0';
// observationTime::(boolean)normal; 0 = abnormal, 1 = normal
$tmpArr[] = '0';
//sign
//$this->_calcLabResults[uniqid()] = $tmpArr;
$this->_calcLabResults[1] = $tmpArr;
// temporarily set index to one(1) to be able to include in selected lab results
return $tmpArr;
}
开发者ID:dragonlet,项目名称:clearhealth,代码行数:60,代码来源:CalcLabs.php
示例6: autoMagic
/**
* @param EveApiReadWriteInterface $data
* @param EveApiRetrieverInterface $retrievers
* @param EveApiPreserverInterface $preservers
* @param int $interval
*
* @throws LogicException
*/
public function autoMagic(EveApiReadWriteInterface $data, EveApiRetrieverInterface $retrievers, EveApiPreserverInterface $preservers, $interval)
{
$this->getLogger()->debug(sprintf('Starting autoMagic for %1$s/%2$s', $this->getSectionName(), $this->getApiName()));
/**
* Update Industry Jobs History
*/
$class = new IndustryJobsHistory($this->getPdo(), $this->getLogger(), $this->getCsq());
$class->autoMagic($data, $retrievers, $preservers, $interval);
$active = $this->getActiveCharacters();
if (0 === count($active)) {
$this->getLogger()->info('No active characters found');
return;
}
foreach ($active as $char) {
$data->setEveApiSectionName(strtolower($this->getSectionName()))->setEveApiName($this->getApiName());
if ($this->cacheNotExpired($this->getApiName(), $this->getSectionName(), $char['characterID'])) {
continue;
}
$data->setEveApiArguments($char)->setEveApiXml();
if (!$this->oneShot($data, $retrievers, $preservers, $interval)) {
continue;
}
$this->updateCachedUntil($data->getEveApiXml(), $interval, $char['characterID']);
}
}
开发者ID:yapeal,项目名称:yapeal,代码行数:33,代码来源:IndustryJobs.php
示例7: prompt_bool_input
public static function prompt_bool_input($question, $default = true, $question_id = 'UNKNOWN')
{
// Prompt user for yes/no question
/*if BATCH MODE
{
switch($question_id)
{
default:
$auto_answer = 'true';
break;
}
$answer = pts_strings::string_bool($auto_answer);
}*/
$question .= ' (' . ($default == true ? 'Y/n' : 'y/N') . '): ';
do {
pts_client::$display->generic_prompt($question);
$input = strtolower(pts_user_io::read_user_input());
} while ($input != 'y' && $input != 'n' && $input != '');
switch ($input) {
case 'y':
$answer = true;
break;
case 'n':
$answer = false;
break;
default:
$answer = $default;
break;
}
return $answer;
}
开发者ID:pacificIT,项目名称:phoronix-test-suite,代码行数:32,代码来源:pts_user_io.php
示例8: makeApiCall
/**
* Execute API Call
*
* @param string $apiCall API Call
* @param string $method Http Method
* @param array $parameters API call parameters
*
* @return array
*/
public static function makeApiCall($apiCall, $method = 'GET', $parameters = array())
{
self::getHttp();
$apiEndpoint = NenoSettings::get('api_server_url');
$licenseCode = NenoSettings::get('license_code');
$response = null;
$responseStatus = false;
if (!empty($apiEndpoint) && !empty($licenseCode)) {
$method = strtolower($method);
if (method_exists(self::$httpClient, $method)) {
if ($method === 'get') {
if (!empty($parameters)) {
$query = implode('/', $parameters);
$apiCall = $apiCall . '/' . $query;
}
$apiResponse = self::$httpClient->{$method}($apiEndpoint . $apiCall, array('Authorization' => $licenseCode));
} else {
$apiResponse = self::$httpClient->{$method}($apiEndpoint . $apiCall, json_encode($parameters), array('Content-Type' => 'application/json', 'Authorization' => $licenseCode));
}
/* @var $apiResponse JHttpResponse */
$data = $apiResponse->body;
if ($apiResponse->headers['Content-Type'] === 'application/json') {
$data = json_decode($data, true);
}
$response = $data;
if ($apiResponse->code == 200) {
$responseStatus = true;
}
}
}
return array($responseStatus, $response);
}
开发者ID:andresmaeso,项目名称:neno,代码行数:41,代码来源:api.php
示例9: db
function db($dbhost, $dbuser, $dbpw, $dbname = '', $dbcharset = 'utf8', $pconnect = 0)
{
if ($pconnect) {
if (!($this->mlink = @mysql_pconnect($dbhost, $dbuser, $dbpw))) {
$this->halt('Can not connect to MySQL');
}
} else {
if (!($this->mlink = @mysql_connect($dbhost, $dbuser, $dbpw))) {
$this->halt('Can not connect to MySQL');
}
}
if ($this->version() > '4.1') {
if ('utf-8' == strtolower($dbcharset)) {
$dbcharset = 'utf8';
}
if ($dbcharset) {
mysql_query("SET character_set_connection={$dbcharset}, character_set_results={$dbcharset}, character_set_client=binary", $this->mlink);
}
if ($this->version() > '5.0.1') {
mysql_query("SET sql_mode=''", $this->mlink);
}
}
if ($dbname) {
mysql_select_db($dbname, $this->mlink);
}
}
开发者ID:eappl,项目名称:prototype,代码行数:26,代码来源:db.class.php
示例10: __construct
function __construct()
{
parent::__construct();
$this->module=strtolower(get_class());
$this->load->model('Mtintuc');
$this->load->library('pagination');
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:7,代码来源:tintuc.php
示例11: loadController
function loadController($class)
{
if (file_exists(CONTROLLERS_DIR . DS . strtolower($class) . '.php')) {
require_once CONTROLLERS_DIR . DS . strtolower($class) . '.php';
}
return;
}
开发者ID:raxbg,项目名称:Jedi-Framework,代码行数:7,代码来源:autoload.php
示例12: lostpasswordAction
public function lostpasswordAction()
{
$username = $this->_getParam("username");
if ($username) {
$user = User::getByName($username);
if (!$user instanceof User) {
$this->view->error = "user unknown";
} else {
if ($user->isActive()) {
if ($user->getEmail()) {
$token = Pimcore_Tool_Authentication::generateToken($username, $user->getPassword(), MCRYPT_TRIPLEDES, MCRYPT_MODE_ECB);
$protocol = "http://";
if (strpos(strtolower($_SERVER["SERVER_PROTOCOL"]), "https") === 0) {
$protocol = "https://";
}
$uri = $protocol . $_SERVER['SERVER_NAME'];
$loginUrl = $uri . "/admin/login/login/?username=" . $username . "&token=" . $token;
try {
$mail = Pimcore_Tool::getMail(array($user->getEmail()), "Pimcore lost password service");
$mail->setBodyText("Login to pimcore and change your password using the following link. This temporary login link will expire in 30 minutes: \r\n\r\n" . $loginUrl);
$mail->send();
$this->view->success = true;
} catch (Exception $e) {
$this->view->error = "could not send email";
}
} else {
$this->view->error = "user has no email address";
}
} else {
$this->view->error = "user inactive";
}
}
}
}
开发者ID:nblackman,项目名称:pimcore,代码行数:34,代码来源:LoginController.php
示例13: processTagName
private function processTagName($name)
{
$name = strtolower($name);
$name = $name == 'col' ? 'td' : $name;
$name = $name == 'row' ? 'tr' : $name;
return $name;
}
开发者ID:hilobok,项目名称:AnhContentChartsBundle,代码行数:7,代码来源:TableFilter.php
示例14: authenticate
public function authenticate($user_)
{
if (!isset($this->login)) {
return false;
}
return strtolower($this->login) == strtolower($user_->getAttribute('login'));
}
开发者ID:skdong,项目名称:nfs-ovd,代码行数:7,代码来源:RemoteUser.php
示例15: __construct
function __construct()
{
// Extract the query from the tag chunk
if (($sql = ee()->TMPL->fetch_param('sql')) === FALSE) {
return FALSE;
}
// Rudimentary check to see if it's a SELECT query, most definitely not
// bulletproof
if (substr(strtolower(trim($sql)), 0, 6) != 'select') {
return FALSE;
}
$query = ee()->db->query($sql);
$results = $query->result_array();
if ($query->num_rows() == 0) {
return $this->return_data = ee()->TMPL->no_results();
}
// Start up pagination
ee()->load->library('pagination');
$pagination = ee()->pagination->create();
ee()->TMPL->tagdata = $pagination->prepare(ee()->TMPL->tagdata);
$per_page = ee()->TMPL->fetch_param('limit', 0);
// Disable pagination if the limit parameter isn't set
if (empty($per_page)) {
$pagination->paginate = FALSE;
}
if ($pagination->paginate) {
$pagination->build($query->num_rows(), $per_page);
$results = array_slice($results, $pagination->offset, $pagination->per_page);
}
$this->return_data = ee()->TMPL->parse_variables(ee()->TMPL->tagdata, array_values($results));
if ($pagination->paginate === TRUE) {
$this->return_data = $pagination->render($this->return_data);
}
}
开发者ID:stb74,项目名称:eeguide,代码行数:34,代码来源:mod.query.php
示例16: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
JHtml::_('jquery.framework');
NNFrameworkFunctions::addScriptVersion(JUri::root(true) . '/media/nnframework/js/script.min.js');
if ($file = $this->get('file')) {
$label = $this->get('label', 'the main extension');
NNFieldDependency::setMessage($file, $label);
return '';
}
$path = $this->get('path') == 'site' ? '' : '/administrator';
$label = $this->get('label');
$file = $this->get('alias', $label);
$file = preg_replace('#[^a-z-]#', '', strtolower($file));
$extension = $this->get('extension');
switch ($extension) {
case 'com':
$file = $path . '/components/com_' . $file . '/com_' . $file . '.xml';
break;
case 'mod':
$file = $path . '/modules/mod_' . $file . '/mod_' . $file . '.xml';
break;
case 'plg_editors-xtd':
$file = '/plugins/editors-xtd/' . $file . '.xml';
break;
default:
$file = '/plugins/system/' . $file . '.xml';
break;
}
$label = JText::_($label) . ' (' . JText::_('NN_' . strtoupper($extension)) . ')';
NNFieldDependency::setMessage($file, $label);
return '';
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:33,代码来源:dependency.php
示例17: getValue
/**
* Gets the attribute 'checked'
* Used with the element 'input' only if type attribute has the value
* 'radio, checkbox'
* Case insensitive
*
* When the type attribute has the value "radio" or "checkbox",
* this boolean attribute specifies that the button is on.
* User agents must ignore this attribute for other control types.
*
* @return string Attribute value
*/
public function getValue()
{
if ((int) $this->value === 1 || (bool) $this->value === TRUE || strtolower((string) $this->value === 'checked')) {
$attribute = 'checked';
}
return $attribute;
}
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:19,代码来源:CheckedAttribute.php
示例18: w2l_sksort
/**
* Sort input array by $subkey
* Taken from: http://php.net/manual/en/function.ksort.php
*/
function w2l_sksort(&$array, $subkey = "id", $sort_ascending = false)
{
if (!is_array($array)) {
return $array;
}
$temp_array = array();
if (count($array)) {
$temp_array[key($array)] = array_shift($array);
}
foreach ($array as $key => $val) {
$offset = 0;
$found = false;
foreach ($temp_array as $tmp_key => $tmp_val) {
if (!$found and strtolower($val[$subkey]) > strtolower($tmp_val[$subkey])) {
$temp_array = array_merge((array) array_slice($temp_array, 0, $offset), array($key => $val), array_slice($temp_array, $offset));
$found = true;
}
$offset++;
}
if (!$found) {
$temp_array = array_merge($temp_array, array($key => $val));
}
}
if ($sort_ascending) {
$array = array_reverse($temp_array);
} else {
$array = $temp_array;
}
}
开发者ID:jimdough,项目名称:Roadmaster,代码行数:33,代码来源:salesforce.php
示例19: get_html
function get_html($tree = null)
{
$tag_name = 'ul';
$type = '';
switch ($this->tag) {
case 'ol':
$tag_name = 'ol';
$type = strtolower($this->attrib['ol']);
break;
case 'list':
if ($this->attrib['list']) {
$tag_name = 'ol';
}
$type = strtolower($this->attrib['list']);
$this->tag = 'del';
}
$attr = ' class="bb"';
if ('1' == $type) {
$attr .= ' type="1"';
} elseif ($type) {
$attr .= ' type="a"';
}
$str = '<' . $tag_name . $attr . '>' . parent::get_html() . '</' . $tag_name . '>';
return $str;
}
开发者ID:ei-grad,项目名称:phorm,代码行数:25,代码来源:List.php
示例20: resetCustomLPDataForUserIds
protected function resetCustomLPDataForUserIds(array $a_user_ids, $a_recursive = true)
{
/* @var ilObjTest $testOBJ */
require_once 'Services/Object/classes/class.ilObjectFactory.php';
$testOBJ = ilObjectFactory::getInstanceByObjId($this->obj_id);
$testOBJ->removeTestResults($a_user_ids);
// :TODO: there has to be a better way
$test_ref_id = (int) $_REQUEST["ref_id"];
if ($test_ref_id) {
require_once "Modules/Course/classes/Objectives/class.ilLOSettings.php";
$course_obj_id = ilLOSettings::isObjectiveTest($test_ref_id);
if ($course_obj_id) {
// is test initial and/or qualified?
$lo_settings = ilLOSettings::getInstanceByObjId($course_obj_id);
$is_i = $lo_settings->getInitialTest() == $test_ref_id;
$is_q = $lo_settings->getQualifiedTest() == $test_ref_id;
// remove objective results data
require_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
ilLOUserResults::deleteResultsFromLP($course_obj_id, $a_user_ids, $is_i, $is_q);
// refresh LP - see ilLPStatusWrapper::_updateStatus()
require_once "Services/Tracking/classes/class.ilLPStatusFactory.php";
$lp_status = ilLPStatusFactory::_getInstance($course_obj_id);
if (strtolower(get_class($lp_status)) != "illpstatus") {
foreach ($a_user_ids as $user_id) {
$lp_status->_updateStatus($course_obj_id, $user_id);
}
}
}
}
}
开发者ID:bheyser,项目名称:qplskl,代码行数:30,代码来源:class.ilTestLP.php
注:本文中的strtolower函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论