本文整理汇总了PHP中stripos函数的典型用法代码示例。如果您正苦于以下问题:PHP stripos函数的具体用法?PHP stripos怎么用?PHP stripos使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了stripos函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: IsStrongCondition
public function IsStrongCondition()
{
if (stripos($this->Conditions, " or ") !== false) {
return true;
}
return false;
}
开发者ID:sigmadesarrollo,项目名称:logisoft,代码行数:7,代码来源:SqlCommandOptions.php
示例2: getListQuery
/**
* Build an SQL query to load the list data.
*
* @return JDatabaseQuery
* @since 1.6
*/
protected function getListQuery()
{
$db = $this->getDbo();
/** @var $db JDatabaseMySQLi */
// Create a new query object.
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select($this->getState('list.select', 'a.id, a.record_date, a.votes, a.item_id, ' . 'b.title, ' . 'c.name'));
$query->from($db->quoteName('#__uideas_votes') . ' AS a');
$query->innerJoin($db->quoteName('#__uideas_items') . ' AS b ON a.item_id = b.id');
$query->leftJoin($db->quoteName('#__users') . ' AS c ON a.user_id = c.id');
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search)) {
if (stripos($search, 'id:') === 0) {
$query->where('a.id = ' . (int) substr($search, 3));
} else {
$escaped = $db->escape($search, true);
$quoted = $db->quote("%" . $escaped . "%", false);
$query->where('b.title LIKE ' . $quoted, "OR");
$query->where('c.name LIKE ' . $quoted);
}
}
// Add the list ordering clause.
$orderString = $this->getOrderString();
$query->order($db->escape($orderString));
return $query;
}
开发者ID:pippogsm,项目名称:UserIdeas,代码行数:34,代码来源:votes.php
示例3: saveInternalEncoding
/**
* Alter the Environment Internal Encoding if it is not utf-8
*
* @return void
*/
protected function saveInternalEncoding()
{
$this->encoding = mb_internal_encoding();
if (stripos($this->encoding, 'utf-8') === false) {
mb_internal_encoding('UTF-8');
}
}
开发者ID:yakamoz-fang,项目名称:concrete,代码行数:12,代码来源:Host.php
示例4: getReferencableEntities
/**
* Implements EntityReferenceHandler::getReferencableEntities().
*/
public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0)
{
$settings = $this->field['settings']['handler_settings'];
$include_space = $settings['include_space'];
$all_groups = oa_core_get_all_groups();
$groups = array_map(create_function('$group', 'return $group->title;'), $all_groups);
$group_options = array();
$count = 0;
foreach ($groups as $nid => $group_name) {
$count++;
if (!$match || stripos($group_name, $match) !== FALSE) {
$group_options[$nid] = $group_name;
}
if ($limit && $count == $limit) {
break;
}
}
if ($space_id = oa_core_get_space_context()) {
// Bring current group to front.
if (!empty($group_options[$space_id])) {
$group_options = array($space_id => t('!name (current)', array('!name' => $group_options[$space_id]))) + $group_options;
} elseif ($include_space) {
$group_options = array($space_id => t('- All space members -')) + $group_options;
}
}
return array(OA_GROUP_TYPE => $group_options);
}
开发者ID:radimklaska,项目名称:openatrium-drops-7,代码行数:30,代码来源:OaGroupsSelectionHandler.class.php
示例5: getListQuery
/**
* Build an SQL query to load the list data.
*
* @return JDatabaseQuery
* @since 1.6
*/
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
/** @var $db JDatabaseDriver */
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select($this->getState('list.select', 'a.id, a.name, a.code, a.code4, a.latitude, a.longitude, a.timezone'));
$query->from($db->quoteName('#__crowdf_countries', 'a'));
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search)) {
if (stripos($search, 'id:') === 0) {
$query->where('a.id = ' . (int) substr($search, 3));
} else {
$escaped = $db->escape($search, true);
$quoted = $db->quote("%" . $escaped . "%", false);
$query->where('a.name LIKE ' . $quoted);
}
}
// Add the list ordering clause.
$orderString = $this->getOrderString();
$query->order($db->escape($orderString));
return $query;
}
开发者ID:Eautentik,项目名称:CrowdFunding,代码行数:31,代码来源:countries.php
示例6: getListQuery
/**
* Method to build an SQL query to load the list data.
*
* @return string An SQL query
*/
protected function getListQuery()
{
$db = $this->getDbo();
$query = $db->getQuery(true);
$query->select("u.*");
$query->from("#__bt_user_fields AS u");
$search = $this->getState('filter.search');
if (!empty($search)) {
if (stripos($search, 'id:') === 0) {
$query->where('u.id = ' . (int) substr($search, 3));
} else {
$search = $db->Quote('%' . $db->escape($search, true) . '%');
$query->where('(u.name LIKE ' . $search . ' OR u.type LIKE ' . $search . ')');
}
}
$fieldtype = $this->getState('filter.fieldtype');
if (!empty($fieldtype)) {
$query->where(' u.type ="' . $fieldtype . '"');
}
// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('u.published = ' . (int) $published);
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering');
$orderDirn = $this->state->get('list.direction');
if ($orderCol == 'u.ordering') {
$orderCol = 'u.ordering';
}
$query->order($db->escape($orderCol . ' ' . $orderDirn));
$query->order($db->escape($orderCol . ' ' . $orderDirn));
return $query;
}
开发者ID:juanferden,项目名称:adoperp,代码行数:39,代码来源:userfields.php
示例7: __construct
/**
* Constructor.
*
* @param callable|object $classLoader Passing an object is @deprecated since version 2.5 and support for it will be removed in 3.0
*/
public function __construct($classLoader)
{
$this->wasFinder = is_object($classLoader) && method_exists($classLoader, 'findFile');
if ($this->wasFinder) {
@trigger_error('The ' . __METHOD__ . ' method will no longer support receiving an object into its $classLoader argument in 3.0.', E_USER_DEPRECATED);
$this->classLoader = array($classLoader, 'loadClass');
$this->isFinder = true;
} else {
$this->classLoader = $classLoader;
$this->isFinder = is_array($classLoader) && method_exists($classLoader[0], 'findFile');
}
if (!isset(self::$caseCheck)) {
$file = file_exists(__FILE__) ? __FILE__ : rtrim(realpath('.'), DIRECTORY_SEPARATOR);
$i = strrpos($file, DIRECTORY_SEPARATOR);
$dir = substr($file, 0, 1 + $i);
$file = substr($file, 1 + $i);
$test = strtoupper($file) === $file ? strtolower($file) : strtoupper($file);
$test = realpath($dir . $test);
if (false === $test || false === $i) {
// filesystem is case sensitive
self::$caseCheck = 0;
} elseif (substr($test, -strlen($file)) === $file) {
// filesystem is case insensitive and realpath() normalizes the case of characters
self::$caseCheck = 1;
} elseif (false !== stripos(PHP_OS, 'darwin')) {
// on MacOSX, HFS+ is case insensitive but realpath() doesn't normalize the case of characters
self::$caseCheck = 2;
} else {
// filesystem case checks failed, fallback to disabling them
self::$caseCheck = 0;
}
}
}
开发者ID:phantsang,项目名称:8csfOIjOaJSlDG2Y3x992O,代码行数:38,代码来源:DebugClassLoader.php
示例8: azuratestimonial_sc
function azuratestimonial_sc($atts, $content = "")
{
extract(shortcode_atts(array('id' => '', 'class' => 'pesbox', 'name' => '', 'email' => '', 'avatar' => '', 'position' => '', 'review' => '5', 'layout' => ''), $atts));
$styleArr = shortcode_atts(array('margin_top' => '', 'margin_right' => '', 'margin_bottom' => '', 'margin_left' => '', 'border_top_width' => '', 'border_right_width' => '', 'border_bottom_width' => '', 'border_left_width' => '', 'padding_top' => '', 'padding_right' => '', 'padding_bottom' => '', 'padding_left' => '', 'border_color' => '', 'border_style' => '', 'background_color' => '', 'background_image' => '', 'background_repeat' => '', 'background_attachment' => '', 'background_size' => '', 'additional_style' => '', 'simplified' => ''), $atts);
$styleTextArr = CthShortcodes::parseStyle($styleArr);
$testimonialstyle = '';
$styleText = implode(" ", $styleTextArr);
$styleTextTest = trim($styleText);
if (!empty($styleTextTest)) {
$testimonialstyle .= trim($styleText);
}
if (!empty($testimonialstyle)) {
$testimonialstyle = 'style="' . $testimonialstyle . '"';
}
$animationArgs = shortcode_atts(array('animation' => '0', 'trigger' => 'animate', 'animationtype' => '', 'animationdelay' => ''), $atts);
$shortcodeTemp = false;
if (stripos($layout, '_:') !== false) {
$shortcodeTemp = JPATH_PLUGINS . '/system/cthshortcodes/shortcodes_template/' . substr($layout, 2) . '.php';
} else {
if (stripos($layout, ':') !== false) {
$shortcodeTemp = CthShortcodes::templatePath() . '/html/com_azurapagebuilder/plugin/shortcodes_template/' . substr($layout, stripos($layout, ':') + 1) . '.php';
} else {
$shortcodeTemp = CthShortcodes::addShortcodeTemplate('azuratestimonial');
}
}
$buffer = ob_get_clean();
ob_start();
if ($shortcodeTemp !== false) {
require $shortcodeTemp;
}
$content = ob_get_clean();
ob_start();
echo $buffer;
return $content;
}
开发者ID:sankam-nikolya,项目名称:lptt,代码行数:35,代码来源:azuratestimonial.php
示例9: file_upload
function file_upload($html)
{
// Define wp upload folder
$main_path = wp_upload_dir();
$current_path = '';
// Instaniate Post_Get class
$get = new Post_Get();
// Check if GET variable has value
$get->exists('GET');
$current_path = $get->get('upload_dir');
// Define the folder directory that will hold the content
$container = $main_path['basedir'] . '/upload_dir';
// Create upload_dir folder to hold the documents that will be uploaded
if (!file_exists($container)) {
mkdir($container, 0755, true);
}
// Define current url
$current_url = $main_path['baseurl'] . '/upload_dir/';
// Scan current directory
$current_dir = scandir($main_path['basedir'] . '/upload_dir/' . $current_path);
// Wrap the retusts in unordered list
$html .= "<ul>";
// Loop throught current folder
foreach ($current_dir as $file) {
if (stripos($file, '.') !== 0) {
if (strpos($file, '.html') > -1) {
$html .= '<li><a href="' . $current_url . $current_path . '/' . $file . '">' . $file . '</a></li>';
} else {
$html .= '<li><a href="?upload_dir=' . $current_path . '/' . $file . '">' . $file . '</a></li>';
}
}
}
$html .= '</ul>';
return $html;
}
开发者ID:mussealani,项目名称:uppload-files,代码行数:35,代码来源:upload-file.php
示例10: handle
public function handle($request, \Closure $next)
{
$agent = "";
if (stripos($request->header('user_agent'), 'Firefox') !== false) {
$agent = 'Firefox';
} elseif (stripos($request->header('user_agent'), 'MSIE') !== false) {
$agent = 'IE';
} elseif (stripos($request->header('user_agent'), 'iPad') !== false) {
$agent = 'iPad';
} elseif (stripos($request->header('user_agent'), 'Android') !== false) {
$agent = 'Android';
} elseif (stripos($request->header('user_agent'), 'Chrome') !== false) {
$agent = 'Chrome';
} elseif (stripos($request->header('user_agent'), 'Safari') !== false) {
$agent = 'Safari';
} elseif (stripos($request->header('user_agent'), 'AIR') !== false) {
$agent = 'Air';
} elseif (stripos($request->header('user_agent'), 'Fluid') !== false) {
$agent = 'Fluid';
}
if ($agent == "") {
$agent = 'Terminal';
}
file_put_contents('log', '/' . $request->path() . ' ' . $agent . "\r\n", FILE_APPEND);
return $next($request);
}
开发者ID:Rep2,项目名称:QUIZ,代码行数:26,代码来源:Log.php
示例11: _getList
/**
* Returns an object list
*
* @param string The query
* @param int Offset
* @param int The number of records
* @return array
*/
protected function _getList($query, $limitstart = 0, $limit = 0)
{
$ordering = $this->getState('list.ordering');
$search = $this->getState('filter.search');
// Replace slashes so preg_match will work
$search = str_replace('/', ' ', $search);
$db = $this->getDbo();
if ($ordering == 'name' || !empty($search) && stripos($search, 'id:') !== 0) {
$db->setQuery($query);
$result = $db->loadObjectList();
$lang = JFactory::getLanguage();
$this->translate($result);
if (!empty($search)) {
foreach ($result as $i => $item) {
if (!preg_match("/{$search}/i", $item->name)) {
unset($result[$i]);
}
}
}
JArrayHelper::sortObjects($result, $this->getState('list.ordering'), $this->getState('list.direction') == 'desc' ? -1 : 1, true, $lang->getLocale());
$total = count($result);
$this->cache[$this->getStoreId('getTotal')] = $total;
if ($total < $limitstart) {
$limitstart = 0;
$this->setState('list.start', 0);
}
return array_slice($result, $limitstart, $limit ? $limit : null);
} else {
$query->order($db->quoteName($ordering) . ' ' . $this->getState('list.direction'));
$result = parent::_getList($query, $limitstart, $limit);
$this->translate($result);
return $result;
}
}
开发者ID:acculitx,项目名称:fleetmatrixsite,代码行数:42,代码来源:extension.php
示例12: ajax_query
function ajax_query()
{
// options
$options = acf_parse_args($_POST, array('post_id' => 0, 's' => '', 'field_key' => '', 'nonce' => ''));
// load field
$field = acf_get_field($options['field_key']);
if (!$field) {
die;
}
// vars
$r = array();
$s = false;
// search
if ($options['s'] !== '') {
// search may be integer
$s = strval($options['s']);
// strip slashes
$s = wp_unslash($s);
}
// loop through choices
if (!empty($field['choices'])) {
foreach ($field['choices'] as $k => $v) {
// if searching, but doesn't exist
if ($s !== false && stripos($v, $s) === false) {
continue;
}
// append
$r[] = array('id' => $k, 'text' => strval($v));
}
}
// return JSON
echo json_encode($r);
die;
}
开发者ID:SayenkoDesign,项目名称:bushcooking.com,代码行数:34,代码来源:select.php
示例13: onEvent
public function onEvent(GenericEvent $event, $eventName)
{
if (!$this->enforceHttps) {
return;
}
$nossl = $this->request->get('nossl');
if ($nossl !== null) {
$nossl = strtolower($nossl);
if ($nossl === 'false' || $nossl === 'off') {
$this->response->headers->clearCookie('nossl');
$this->request->cookies->remove('nossl');
} else {
$this->response->headers->setCookie(new Cookie('nossl', 'on'));
$this->request->cookies->set('nossl', 'on');
}
}
if (!$this->request->isSecure() && $this->request->cookies->get('nossl') === null) {
$ua = $this->request->getUserAgent();
//Unsafe search engine friendly
if ($ua !== null && stripos($ua, 'Baiduspider') === false && stripos($ua, 'Sogou web spider') === false && stripos($ua, 'Sosospider') === false) {
$this->response->redirect('https://' . $this->request->headers->get('host', $this->canonical) . $this->request->getRequestUri());
$event->stopPropagation();
}
}
}
开发者ID:Tanklong,项目名称:openvj,代码行数:25,代码来源:HttpsRedirectionService.php
示例14: getOS
function getOS()
{
if (stripos($_SERVER['SERVER_SOFTWARE'], "win") !== false || stripos(PHP_OS, "win") !== false) {
$os = "Windows";
} elseif (stripos($_SERVER['SERVER_SOFTWARE'], "mac") !== false || stripos(PHP_OS, "mac") !== false || stripos($_SERVER['SERVER_SOFTWARE'], "ppc") !== false || stripos(PHP_OS, "ppc") !== false) {
$os = "Mac";
} elseif (stripos($_SERVER['SERVER_SOFTWARE'], "linux") !== false || stripos(PHP_OS, "linux") !== false) {
$os = "Linux";
} elseif (stripos($_SERVER['SERVER_SOFTWARE'], "freebsd") !== false || stripos(PHP_OS, "freebsd") !== false) {
$os = "FreeBSD";
} elseif (stripos($_SERVER['SERVER_SOFTWARE'], "sunos") !== false || stripos(PHP_OS, "sunos") !== false) {
$os = "SunOS";
} elseif (stripos($_SERVER['SERVER_SOFTWARE'], "irix") !== false || stripos(PHP_OS, "irix") !== false) {
$os = "IRIX";
} elseif (stripos($_SERVER['SERVER_SOFTWARE'], "beos") !== false || stripos(PHP_OS, "beos") !== false) {
$os = "BeOS";
} elseif (stripos($_SERVER['SERVER_SOFTWARE'], "os/2") !== false || stripos(PHP_OS, "os/2") !== false) {
$os = "OS/2";
} elseif (stripos($_SERVER['SERVER_SOFTWARE'], "aix") !== false || stripos(PHP_OS, "aix") !== false) {
$os = "AIX";
} else {
$os = "Autre";
}
return $os;
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:25,代码来源:pmbesTasks.class.php
示例15: ajax_query
function ajax_query()
{
// options
$options = acf_parse_args($_GET, array('post_id' => 0, 's' => '', 'field_key' => '', 'nonce' => ''));
// load field
$field = acf_get_field($options['field_key']);
if (!$field) {
die;
}
// vars
$r = array();
// strip slashes
$options['s'] = wp_unslash($options['s']);
if (!empty($field['choices'])) {
foreach ($field['choices'] as $k => $v) {
// search
if ($options['s'] && stripos($v, $options['s']) === false) {
continue;
}
// append
$r[] = array('id' => $k, 'text' => strval($v));
}
}
// return JSON
echo json_encode($r);
die;
}
开发者ID:pellio11,项目名称:ns-select-project,代码行数:27,代码来源:select.php
示例16: form_open
function form_open($action = '', $attributes = array(), $hidden = array())
{
$CI =& get_instance();
// If no action is provided then set to the current url
if (!$action) {
$action = current_url($action);
} elseif (strpos($action, '://') === FALSE) {
$action = if_secure_site_url($action);
}
$attributes = _attributes_to_string($attributes);
if (stripos($attributes, 'method=') === FALSE) {
$attributes .= ' method="post"';
}
if (stripos($attributes, 'accept-charset=') === FALSE) {
$attributes .= ' accept-charset="' . strtolower(config_item('charset')) . '"';
}
$form = '<form action="' . $action . '"' . $attributes . ">\n";
// Add CSRF field if enabled, but leave it out for GET requests and requests to external websites
if ($CI->config->item('csrf_protection') === TRUE && strpos($action, if_secure_base_url()) !== FALSE && !stripos($form, 'method="get"')) {
$hidden[$CI->security->get_csrf_token_name()] = $CI->security->get_csrf_hash();
}
// Add MY CSRF token if MY CSRF library is loaded
if ($CI->load->is_loaded('tokens') && strpos($action, if_secure_base_url()) !== FALSE && !stripos($form, 'method="get"')) {
$hidden[$CI->tokens->name] = $CI->tokens->token();
}
if (is_array($hidden)) {
foreach ($hidden as $name => $value) {
$form .= '<input type="hidden" name="' . $name . '" value="' . html_escape($value) . '" style="display:none;" />' . "\n";
}
}
return $form;
}
开发者ID:railsgem,项目名称:htdocs,代码行数:32,代码来源:MY_form_helper.php
示例17: filterItem
public function filterItem($filters)
{
foreach ($filters as $filter => $value) {
switch ($filter) {
case 'search':
if (stripos($this->getTitle(), $value) === FALSE && stripos($this->getSubTitle(), $value) === FALSE && stripos($this->getDescription(), $value) === FALSE) {
return false;
}
break;
case 'min':
if (!isset($center)) {
$center = $this->getGeometry()->getCenterCoordinate();
}
if ($center['lat'] < $value['lat'] || $center['lon'] < $value['lon']) {
return false;
}
break;
case 'max':
if (!isset($center)) {
$center = $this->getGeometry()->getCenterCoordinate();
}
if ($center['lat'] > $value['lat'] || $center['lon'] > $value['lon']) {
return false;
}
break;
}
}
return true;
}
开发者ID:nncsang,项目名称:Kurogo,代码行数:29,代码来源:KMLPlacemark.php
示例18: __construct
/**
* 架构函数 取得模板对象实例
* @access public
*/
public function __construct()
{
//实例化视图类
$this->view = Think::instance('View');
defined('__EXT__') or define('__EXT__', '');
if ('' == __EXT__ || false === stripos(C('REST_CONTENT_TYPE_LIST'), __EXT__)) {
// 资源类型没有指定或者非法 则用默认资源类型访问
$this->_type = C('REST_DEFAULT_TYPE');
} else {
$this->_type = __EXT__;
}
// 请求方式检测
$method = strtolower($_SERVER['REQUEST_METHOD']);
if (false === stripos(C('REST_METHOD_LIST'), $method)) {
// 请求方式非法 则用默认请求方法
$method = C('REST_DEFAULT_METHOD');
}
$this->_method = $method;
// 允许输出的资源类型
$this->_types = C('REST_OUTPUT_TYPE');
//控制器初始化
if (method_exists($this, '_initialize')) {
$this->_initialize();
}
}
开发者ID:cnn007,项目名称:FHCRM,代码行数:29,代码来源:Action.class.php
示例19: startsWith
function startsWith($haystack, $needle, $case = true)
{
if ($case) {
return strpos($haystack, $needle, 0) === 0;
}
return stripos($haystack, $needle, 0) === 0;
}
开发者ID:JustKiddingCode,项目名称:apvel,代码行数:7,代码来源:lib.php
示例20: execute
/**
* @param RepositoryList $repositories
*/
public function execute(RepositoryList $repositories)
{
$model = $repositories->getProjectModel();
$currentBranch = $model->getBranch();
if ($model->hasConflicts()) {
if (false !== stripos($model->getConflicts(), ComposerHelper::COMPOSER_JSON)) {
$this->getSymfonyStyle()->error('You should resolve composer.json conflict first');
$this->stopPropagation();
return;
}
if (false !== stripos($model->getConflicts(), ComposerHelper::COMPOSER_LOCK)) {
try {
$this->getLogger()->debug('Auto-resolve composer.lock conflict');
$vendorsForUpdate = $this->findVendorsForUpdate($model);
$this->resolveComposerConflict($model, ComposerHelper::COMPOSER_LOCK, $currentBranch);
if ($vendorsForUpdate) {
$cmd = $this->getConfig()->getComposerBin() . ' update ' . implode(' ', $vendorsForUpdate);
$this->getSymfonyStyle()->writeln($cmd);
$model->getProvider()->runCommand($cmd, $this->isDryRun(), true);
}
$model->getProvider()->run('add', [ComposerHelper::COMPOSER_LOCK], $this->isDryRun(), false);
} catch (\Exception $e) {
$this->getLogger()->error($e->getMessage(), [$e->getTraceAsString()]);
$this->getSymfonyStyle()->error($e->getMessage());
$this->stopPropagation();
}
}
}
}
开发者ID:octava,项目名称:geggs,代码行数:32,代码来源:ComposerLockPlugin.php
注:本文中的stripos函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论