本文整理汇总了PHP中utf8_strtolower函数的典型用法代码示例。如果您正苦于以下问题:PHP utf8_strtolower函数的具体用法?PHP utf8_strtolower怎么用?PHP utf8_strtolower使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了utf8_strtolower函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: autoTag
/**
* Inserts tag links into an HTML-formatted text.
*
* @param string $html
* @param array $tags
* @param array $options
* @return string
*/
public static function autoTag($html, array $tags, array &$options = array())
{
if (empty($tags)) {
return $html;
}
$html = strval($html);
$htmlNullified = utf8_strtolower($html);
$htmlNullified = preg_replace_callback('#<a[^>]+>.+?</a>#', array(__CLASS__, '_autoTag_nullifyHtmlCallback'), $htmlNullified);
$htmlNullified = preg_replace_callback('#<[^>]+>#', array(__CLASS__, '_autoTag_nullifyHtmlCallback'), $htmlNullified);
// prepare the options
$onceOnly = empty($options['onceOnly']) ? false : true;
$options['autoTagged'] = array();
// reset this
// sort tags with the longest one first
// since 1.0.3
usort($tags, array(__CLASS__, '_autoTag_sortTagsByLength'));
foreach ($tags as $tag) {
$offset = 0;
$tagText = utf8_strtolower($tag['tag']);
$tagLength = utf8_strlen($tagText);
while (true) {
$pos = utf8_strpos($htmlNullified, $tagText, $offset);
if ($pos !== false) {
// the tag has been found
if (self::_autoTag_hasValidCharacterAround($html, $pos, $tagText)) {
// and it has good surrounding characters
// start replacing
$displayText = utf8_substr($html, $pos, $tagLength);
$template = new XenForo_Template_Public('tinhte_xentag_bb_code_tag_tag');
$template->setParam('tag', $tag);
$template->setParam('displayText', $displayText);
$replacement = $template->render();
if (strlen($replacement) === 0) {
// in case template system hasn't been initialized
$replacement = sprintf('<a href="%s">%s</a>', XenForo_Link::buildPublicLink('tags', $tag), $displayText);
}
$html = utf8_substr_replace($html, $replacement, $pos, $tagLength);
$htmlNullified = utf8_substr_replace($htmlNullified, str_repeat('_', utf8_strlen($replacement)), $pos, $tagLength);
// sondh@2012-09-20
// keep track of the auto tagged tags
$options['autoTagged'][$tagText][$pos] = $replacement;
$offset = $pos + utf8_strlen($replacement);
if ($onceOnly) {
// auto link only once per tag
// break the loop now
break;
// while (true)
}
} else {
$offset = $pos + $tagLength;
}
} else {
// no match has been found, stop working with this tag
break;
// while (true)
}
}
}
return $html;
}
示例2: standardise
private static function standardise($langtag)
{
$glue = ',';
$result = is_array($langtag) ? implode($glue, $langtag) : $langtag;
$result = utf8_strtolower(str_replace('_', '-', $result));
return is_array($langtag) ? explode($glue, $result) : $result;
}
示例3: buildFilterString
private function buildFilterString($data = array())
{
$filter = "o.customer_id = " . $this->customer->getId();
if (isset($data['selected_items']) && count($data['selected_items'])) {
$filter = "op.order_product_id in (" . implode($data['selected_items'], ',') . ")";
} else {
if (!empty($data['filter_supplier'])) {
$filter .= ($filter ? " AND" : "") . " LCASE(s.name) LIKE '" . $this->getDb()->escape(utf8_strtolower($data['filter_supplier'])) . "%'";
}
if (!empty($data['filter_supplier_group'])) {
$filter .= ($filter ? " AND" : "") . " s.supplier_group_id = " . (int) $data['filter_supplier_group'];
}
if (!empty($data['filterItem'])) {
$filter .= " AND (\r\n op.model LIKE '%" . $this->getDb()->escape($data['filterItem']) . "%'\r\n OR op.name LIKE '%" . $this->getDb()->escape($data['filterItem']) . "%')";
}
if (!empty($data['filterOrderId'])) {
$filter .= " AND op.order_id = " . (int) $data['filterOrderId'];
}
if (!empty($data['filterOrderItemId'])) {
$filter .= ($filter ? " AND" : "") . " op.order_product_id = " . (int) $data['filterOrderItemId'];
}
if (!empty($data['filterProductId'])) {
$filter .= ($filter ? " AND" : "") . " op.product_id = " . (int) $data['filterProductId'];
}
if (!empty($data['filterStatusId'])) {
$filter .= ($filter ? " AND" : "") . " op.status_id IN (" . implode(', ', $data['filterStatusId']) . ")";
}
}
return $filter;
}
示例4: generateHtmlRecurrence
public function generateHtmlRecurrence($days, $amount, $currency, $comment, array $data, XenForo_View $view)
{
$data[] = utf8_strtolower($currency);
$data[] = $amount;
$processorModel = $this->_getProcessorModel();
$itemId = $processorModel->generateItemId('bdshop', XenForo_Visitor::getInstance(), $data);
$processorNames = $processorModel->getProcessorNames();
$processors = array();
foreach ($processorNames as $processorId => $processorClass) {
$processors[$processorId] = bdPaygate_Processor_Abstract::create($processorClass);
}
$recurringInterval = false;
$recurringUnit = false;
if ($days > 0) {
if ($days % 360 == 0) {
$recurringInterval = $days / 365;
$recurringUnit = bdPaygate_Processor_Abstract::RECURRING_UNIT_YEAR;
} elseif ($days % 30 == 0) {
$recurringInterval = $days / 30;
$recurringUnit = bdPaygate_Processor_Abstract::RECURRING_UNIT_MONTH;
} else {
$recurringInterval = $days;
$recurringUnit = bdPaygate_Processor_Abstract::RECURRING_UNIT_DAY;
}
}
return implode('', bdPaygate_Processor_Abstract::prepareForms($processors, $amount, $currency, $comment, $itemId, $recurringInterval, $recurringUnit, array(bdPaygate_Processor_Abstract::EXTRA_RETURN_URL => XenForo_Link::buildPublicLink('full:shop/thanks'))));
}
示例5: insert_field
public function insert_field($data = array())
{
$name = preg_replace("/[^a-zA-Z0-9_]/", "", utf8_strtolower(isset($data['lang']) ? $data['lang'] : $this->in->get('language')));
if (!$name || !strlen($name)) {
$data['name'] = (isset($data['fieldtype']) ? $data['fieldtype'] : $this->in->get('type')) . '_' . rand();
}
//End if a field with this name exists
$fields = $this->pdh->get('profile_fields', 'fields');
if ($fields[$name]) {
return false;
}
$options = array();
if ($this->in->get('type') == 'dropdown') {
$in_options_id = $this->in->getArray('option_id', 'string');
$in_options_lang = $this->in->getArray('option_lang', 'string');
foreach ($in_options_id as $key => $value) {
if ($value != "" && $in_options_lang[$key] != "") {
$options[$value] = $in_options_lang[$key];
}
}
}
$data = array('name' => isset($data['name']) ? $data['name'] : $name, 'fieldtype' => isset($data['fieldtype']) ? $data['fieldtype'] : $this->in->get('type'), 'category' => isset($data['category']) ? $data['category'] : $this->in->get('category'), 'language' => isset($data['lang']) ? $data['lang'] : $this->in->get('language'), 'size' => isset($data['size']) ? intval($data['size']) : $this->in->get('size', 3), 'options' => isset($data['option']) ? serialize($data['option']) : serialize($options), 'visible' => '1', 'image' => isset($data['image']) ? $data['image'] : $this->in->get('image'), 'undeletable' => $data['undeletable'] ? '1' : '0', 'enabled' => 1, 'custom' => $data['no_custom'] ? '0' : '1');
$sql = $this->db->query("INSERT INTO __member_profilefields :params", $data);
if (!$sql) {
return false;
}
$this->pdh->enqueue_hook('game_update');
return true;
}
示例6: check_password
public function check_password($password, $hash, $strSalt = '', $boolUseHash = false, $strUsername = '')
{
if (sha1(utf8_strtolower($strUsername) . $password) == $hash) {
return true;
}
return false;
}
示例7: getAttributesByAttributeGroupId
public function getAttributesByAttributeGroupId($data = array())
{
$sql = "SELECT *, (SELECT agd.name FROM " . DB_PREFIX . "attribute_group_description agd WHERE agd.attribute_group_id = a.attribute_group_id AND agd.language_id = '" . (int) $this->config->get('config_language_id') . "') AS attribute_group FROM " . DB_PREFIX . "attribute a LEFT JOIN " . DB_PREFIX . "attribute_description ad ON (a.attribute_id = ad.attribute_id) WHERE ad.language_id = '" . (int) $this->config->get('config_language_id') . "'";
if (!empty($data['filter_name'])) {
$sql .= " AND LCASE(ad.name) LIKE '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "%'";
}
if (!empty($data['filter_attribute_group_id'])) {
$sql .= " AND a.attribute_group_id = '" . $this->db->escape($data['filter_attribute_group_id']) . "'";
}
$sort_data = array('ad.name', 'attribute_group', 'a.sort_order');
if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {
$sql .= " ORDER BY " . $data['sort'];
} else {
$sql .= " ORDER BY ad.name";
}
if (isset($data['order']) && $data['order'] == 'DESC') {
$sql .= " DESC";
} else {
$sql .= " ASC";
}
if (isset($data['start']) || isset($data['limit'])) {
if ($data['start'] < 0) {
$data['start'] = 0;
}
if ($data['limit'] < 1) {
$data['limit'] = 20;
}
$sql .= " LIMIT " . (int) $data['start'] . "," . (int) $data['limit'];
}
$query = $this->db->query($sql);
return $query->rows;
}
示例8: getDownloads
public function getDownloads($data = array())
{
$sql = "SELECT * FROM " . DB_PREFIX . "download d LEFT JOIN " . DB_PREFIX . "download_description dd ON (d.download_id = dd.download_id) WHERE dd.language_id = '" . (int) $this->config->get('config_language_id') . "'";
if (!empty($data['filter_name'])) {
$sql .= " AND LCASE(dd.name) LIKE '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "%'";
}
$sort_data = array('dd.name', 'd.remaining');
if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {
$sql .= " ORDER BY " . $data['sort'];
} else {
$sql .= " ORDER BY dd.name";
}
if (isset($data['order']) && $data['order'] == 'DESC') {
$sql .= " DESC";
} else {
$sql .= " ASC";
}
if (isset($data['start']) || isset($data['limit'])) {
if ($data['start'] < 0) {
$data['start'] = 0;
}
if ($data['limit'] < 1) {
$data['limit'] = 20;
}
$sql .= " LIMIT " . (int) $data['start'] . "," . (int) $data['limit'];
}
$query = $this->db->query($sql);
return $query->rows;
}
示例9: login
public function login($email, $password, $customer_id = false)
{
//+mod by yp
//+mod by yp start
if (!$email && !$password && !$customer_id) {
return false;
}
if ($customer_id !== false && preg_match("/^\\d+\$/", $customer_id)) {
$affiliate_query = $this->db->query("SELECT " . DB_PREFIX . "affiliate.* FROM " . DB_PREFIX . "affiliate, " . DB_PREFIX . "accc_customer_affiliate WHERE " . DB_PREFIX . "accc_customer_affiliate.affiliate_id=" . DB_PREFIX . "affiliate.affiliate_id AND " . DB_PREFIX . "accc_customer_affiliate.customer_id = '" . (int) $customer_id . "' AND " . DB_PREFIX . "affiliate.status = '1' AND " . DB_PREFIX . "affiliate.approved = '1' LIMIT 1");
} else {
//+mod by yp end
$affiliate_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "affiliate WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "' AND (password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1('" . $this->db->escape($password) . "'))))) OR password = '" . $this->db->escape(md5($password)) . "') AND status = '1' AND approved = '1'");
}
//+mod by yp
if ($affiliate_query->num_rows) {
$this->_set_own_tracking();
}
//+mod by yp
if ($affiliate_query->num_rows) {
$this->session->data['affiliate_id'] = $affiliate_query->row['affiliate_id'];
$this->affiliate_id = $affiliate_query->row['affiliate_id'];
$this->firstname = $affiliate_query->row['firstname'];
$this->lastname = $affiliate_query->row['lastname'];
$this->email = $affiliate_query->row['email'];
$this->telephone = $affiliate_query->row['telephone'];
$this->fax = $affiliate_query->row['fax'];
$this->code = $affiliate_query->row['code'];
return true;
} else {
return false;
}
}
示例10: login
public function login($email, $password, $override = false)
{
if ($override) {
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "' AND status = '1'");
} else {
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "' AND (password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1('" . $this->db->escape($password) . "'))))) OR password = '" . $this->db->escape(md5($password)) . "') AND status = '1' AND approved = '1'");
}
if ($customer_query->num_rows) {
$this->session->data['customer_id'] = $customer_query->row['customer_id'];
$this->customer_id = $customer_query->row['customer_id'];
$this->firstname = $customer_query->row['firstname'];
$this->lastname = $customer_query->row['lastname'];
$this->customer_group_id = $customer_query->row['customer_group_id'];
$this->email = $customer_query->row['email'];
$this->telephone = $customer_query->row['telephone'];
$this->fax = $customer_query->row['fax'];
$this->newsletter = $customer_query->row['newsletter'];
$this->address_id = $customer_query->row['address_id'];
$this->folder_name = $customer_query->row['folder_name'];
$this->custom_field = $customer_query->row['custom_field'];
$this->db->query("UPDATE " . DB_PREFIX . "customer SET ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "' WHERE customer_id = '" . (int) $this->customer_id . "'");
return true;
} else {
return false;
}
}
示例11: handle
function handle($match, $state, $pos, &$handler)
{
$data = array('task' => array(), 'state' => $state);
switch ($state) {
case DOKU_LEXER_ENTER:
$match = trim(substr($match, 3, -1));
if (preg_match('/\\b(\\d\\d\\d\\d-\\d\\d-\\d\\d)\\b/', $match, $grep)) {
$data['task']['date'] = $grep[1];
$match = trim(str_replace($data['task']['date'], '', $match));
}
if ($match !== '') {
//FIXME call $auth->cleanUser()
$data['task']['user'] = $match;
}
$ReWriter = new Doku_Handler_Nest($handler->CallWriter, 'plugin_do_do');
$handler->CallWriter =& $ReWriter;
$handler->addPluginCall('do_do', $data, $state, $pos, $match);
break;
case DOKU_LEXER_UNMATCHED:
$handler->_addCall('cdata', array($match), $pos);
break;
case DOKU_LEXER_EXIT:
global $ID;
$data['task']['text'] = trim(strip_tags(p_render('xhtml', array_slice($handler->CallWriter->calls, 1), $ignoreme)));
$data['task']['md5'] = md5(utf8_strtolower(preg_replace('/\\s/', '', $data['task']['text'])) . $ID);
// Add missing data from ENTER and EXIT to the other
$handler->CallWriter->calls[0][1][1]['task'] += $data['task'];
$data['task'] += $handler->CallWriter->calls[0][1][1]['task'];
$handler->addPluginCall('do_do', $data, $state, $pos, $match);
$handler->CallWriter->process();
$ReWriter =& $handler->CallWriter;
$handler->CallWriter =& $ReWriter->CallWriter;
}
return false;
}
示例12: getImage
public function getImage()
{
//filemanger library for file type error
include 'include/mime_type_lib.php';
$this->data = $this->load->language('filemanager/filemanager');
$this->load->model('tool/image');
$json = array();
if ($this->request->server['HTTPS']) {
$server = HTTPS_CATALOG;
} else {
$server = HTTP_CATALOG;
}
$filename = basename(html_entity_decode($this->request->get['image_url'], ENT_QUOTES, 'UTF-8'));
// Validate the filename length
if (utf8_strlen($filename) < 3 || utf8_strlen($filename) > 255) {
$json['error'] = $this->data['error_filename'];
}
// Allowed file extension types
$allowed = array('jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg');
if (!in_array(utf8_strtolower(utf8_substr(strrchr($filename, '.'), 1)), $allowed)) {
$json['error'] = $this->data['error_file_type'];
}
$filetype = get_file_mime_type($filename);
// Allowed file mime types
$allowed = array('image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png', 'image/gif');
if (!in_array($filetype, $allowed)) {
$json['error'] = $this->data['error_file_type'];
}
if (!$json && $this->request->get['image_url']) {
$json = array('thumb' => $this->model_tool_image->resize(utf8_substr($this->request->get['image_url'], utf8_strlen($server . 'image/')), 100, 100), 'path' => utf8_substr($this->request->get['image_url'], utf8_strlen($server . 'image/')), 'href' => $this->request->get['image_url']);
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
示例13: handle
function handle()
{
if (!is_array($_REQUEST['d']) || !checkSecurityToken()) {
return;
}
$sqlite = $this->dthlp->_getDB();
if (!$sqlite) {
return false;
}
$sqlite->query("BEGIN TRANSACTION");
if (!$sqlite->query("DELETE FROM aliases")) {
$sqlite->query('ROLLBACK TRANSACTION');
return;
}
foreach ($_REQUEST['d'] as $row) {
$row = array_map('trim', $row);
$row['name'] = utf8_strtolower($row['name']);
$row['name'] = rtrim($row['name'], 's');
if (!$row['name']) {
continue;
}
// Clean enum
$arr = preg_split('/\\s*,\\s*/', $row['enum']);
$arr = array_unique($arr);
asort($arr);
$row['enum'] = implode(', ', $arr);
if (!$sqlite->query("INSERT INTO aliases (name, type, prefix, postfix, enum)\n VALUES (?,?,?,?,?)", $row)) {
$sqlite->query('ROLLBACK TRANSACTION');
return;
}
}
$sqlite->query("COMMIT TRANSACTION");
}
示例14: getTabs
public function getTabs($data = array())
{
$sql = "SELECT * FROM " . DB_PREFIX . "tab t LEFT JOIN " . DB_PREFIX . "tab_description td ON (t.tab_id = td.tab_id) WHERE td.language_id = '" . (int) $this->config->get('config_language_id') . "'";
if (!empty($data['filter_name']) and trim($data['filter_name'], ' ') != '') {
$sql .= " AND LCASE(td.name) LIKE '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "%'";
}
$sort_data = array('td.name', 't.sort_order');
if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {
$sql .= " ORDER BY " . $data['sort'];
} else {
$sql .= " ORDER BY td.name";
}
if (isset($data['order']) && $data['order'] == 'DESC') {
$sql .= " DESC";
} else {
$sql .= " ASC";
}
if (isset($data['start']) || isset($data['limit'])) {
if ($data['start'] < 0) {
$data['start'] = 0;
}
if ($data['limit'] < 1) {
$data['limit'] = 20;
}
$sql .= " LIMIT " . (int) $data['start'] . "," . (int) $data['limit'];
}
$query = $this->db->query($sql);
return $query->rows;
}
示例15: getOptions
public function getOptions($data = array())
{
$sql = "SELECT * FROM `" . DB_PREFIX . "option` o LEFT JOIN " . DB_PREFIX . "option_description od ON (o.option_id = od.option_id) WHERE od.language_id = '" . (int) $this->config->get('config_language_id') . "'";
if (isset($data['filter_name']) && !is_null($data['filter_name'])) {
$sql .= " AND LCASE(od.name) LIKE '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "%'";
}
$sort_data = array('od.name', 'o.type', 'o.sort_order');
if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {
$sql .= " ORDER BY " . $data['sort'];
} else {
$sql .= " ORDER BY od.name";
}
if (isset($data['order']) && $data['order'] == 'DESC') {
$sql .= " DESC";
} else {
$sql .= " ASC";
}
if (isset($data['start']) || isset($data['limit'])) {
if ($data['start'] < 0) {
$data['start'] = 0;
}
if ($data['limit'] < 1) {
$data['limit'] = 20;
}
$sql .= " LIMIT " . (int) $data['start'] . "," . (int) $data['limit'];
}
$query = $this->db->query($sql);
return $query->rows;
}