當前位置: 首頁>>代碼示例>>PHP>>正文


PHP _strpos函數代碼示例

本文整理匯總了PHP中_strpos函數的典型用法代碼示例。如果您正苦於以下問題:PHP _strpos函數的具體用法?PHP _strpos怎麽用?PHP _strpos使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了_strpos函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: strpos

 public static function strpos($str, $search, $offset = 0)
 {
     if (UTF8::$server_utf8) {
         return mb_strpos($str, $search, $offset, JsonApiApplication::$charset);
     }
     if (!isset(UTF8::$called[__FUNCTION__])) {
         require JsonApiApplication::find_file("utf8", __FUNCTION__);
         // Function has been called
         UTF8::$called[__FUNCTION__] = TRUE;
     }
     return _strpos($str, $search, $offset);
 }
開發者ID:benshez,項目名稱:DreamWeddingCeremonies,代碼行數:12,代碼來源:UTF8.php

示例2: strpos

 /**
  * Finds position of first occurrence of a UTF-8 string.
  * @see http://php.net/strlen
  *
  * @author  Harry Fuecks <hfuecks@gmail.com>
  *
  * @param   string   haystack
  * @param   string   needle
  * @param   integer  offset from which character in haystack to start searching
  * @return  integer  position of needle
  * @return  boolean  FALSE if the needle is not found
  */
 public static function strpos($str, $search, $offset = 0)
 {
     if (!isset(self::$called[__FUNCTION__])) {
         require SYSPATH . 'core/utf8/' . __FUNCTION__ . EXT;
         // Function has been called
         self::$called[__FUNCTION__] = TRUE;
     }
     return _strpos($str, $search, $offset);
 }
開發者ID:momoim,項目名稱:momo-api,代碼行數:21,代碼來源:utf8.php

示例3: strpos

 /**
  * Finds position of first occurrence of a UTF-8 string. This is a
  * UTF8-aware version of [strpos](http://php.net/strpos).
  *
  *     $position = UTF8::strpos($str, $search);
  *
  * @author  Harry Fuecks <hfuecks@gmail.com>
  * @param   string   haystack
  * @param   string   needle
  * @param   integer  offset from which character in haystack to start searching
  * @return  integer  position of needle
  * @return  boolean  FALSE if the needle is not found
  * @uses    UTF8::$server_utf8
  */
 public static function strpos($str, $search, $offset = 0)
 {
     if (UTF8::$server_utf8) {
         return mb_strpos($str, $search, $offset, Kohana::$charset);
     }
     if (!isset(self::$called[__FUNCTION__])) {
         require SYSPATH . 'utf8' . DIRECTORY_SEPARATOR . __FUNCTION__ . EXT;
         // Function has been called
         self::$called[__FUNCTION__] = TRUE;
     }
     return _strpos($str, $search, $offset);
 }
開發者ID:gilyaev,項目名稱:framework-bench,代碼行數:26,代碼來源:utf8.php

示例4: strpos

 /**
  * Finds position of first occurrence of a UTF-8 string.
  * @see http://php.net/strlen
  *
  * @author  Harry Fuecks <hfuecks@gmail.com>
  *
  * @param   string   haystack
  * @param   string   needle
  * @param   integer  offset from which character in haystack to start searching
  * @return  integer  position of needle
  * @return  boolean  FALSE if the needle is not found
  */
 public static function strpos($str, $search, $offset = 0)
 {
     require_once dirname(__FILE__) . '/' . __FUNCTION__ . '.php';
     return _strpos($str, $search, $offset);
 }
開發者ID:abhinay100,項目名稱:forma_app,代碼行數:17,代碼來源:lib.utf8.php

示例5: strpos

 /**
  * Finds position of first occurrence of a UTF-8 string
  *
  * This is a UTF8-aware version of [strpos](http://php.net/strpos).
  *
  * Example:
  * ~~~
  * $position = UTF8::strpos($str, $search);
  * ~~~
  *
  * @author  Harry Fuecks <hfuecks@gmail.com>
  *
  * @param   string   $str     Haystack
  * @param   string   $search  Needle
  * @param   integer  $offset  Offset from which character in haystack to start searching [Optional]
  *
  * @return  mixed
  *
  * @uses    UTF8::$server_utf8
  * @uses    Kohana::find_file
  */
 public static function strpos($str, $search, $offset = 0)
 {
     if (self::$server_utf8) {
         return mb_strpos($str, $search, $offset, Kohana::$charset);
     }
     UTF8::_load(__FUNCTION__);
     return _strpos($str, $search, $offset);
 }
開發者ID:ultimateprogramer,項目名稱:cms,代碼行數:29,代碼來源:utf8.php

示例6: strpos

 /**
  * Finds position of first occurrence of a UTF-8 string. This is a
  * UTF8-aware version of [strpos](http://php.net/strpos).
  *
  *     $position = UTF8::strpos($str, $search);
  *
  * @author  Harry Fuecks <hfuecks@gmail.com>
  * @param   string  $str    haystack
  * @param   string  $search needle
  * @param   integer $offset offset from which character in haystack to start searching
  * @return  integer position of needle
  * @return  boolean false if the needle is not found
  * @uses    UTF8::$server_utf8
  * @uses    Phalcana\Phalcana::$charset
  */
 public static function strpos($str, $search, $offset = 0)
 {
     if (UTF8::$server_utf8) {
         return mb_strpos($str, $search, $offset, Phalcana::$charset);
     }
     if (!isset(UTF8::$called[__FUNCTION__])) {
         require Phalcana::$di->get('fs')->findFile('utf8', __FUNCTION__);
         // Function has been called
         UTF8::$called[__FUNCTION__] = true;
     }
     return _strpos($str, $search, $offset);
 }
開發者ID:braf,項目名稱:phalcana-core,代碼行數:27,代碼來源:UTF8.php

示例7: getTextBetweenTags

function getTextBetweenTags($text, $tag)
{
    $StartTag = "<{$tag}";
    $EndTag = "</{$tag}";
    $StartPosTemp = _strpos($text, $StartTag);
    $StartPos = _strpos($text, '>', $StartPosTemp);
    $StartPos = $StartPos + 1;
    $EndPos = _strpos($text, $EndTag);
    $StartAttr = $StartPosTemp + _strlen($StartTag) + 1;
    $EndAttr = $StartPos;
    if ($EndAttr > $StartAttr) {
        $attribute = _substr($text, $StartAttr, $EndAttr - $StartAttr - 1);
        $datas = explode(' ', $attribute);
        for ($i = 0; $i < sizeof($datas); $i++) {
            if (preg_match('/^([a-zA-Z:]+)=["\'](.*)["\']/', $datas[$i], $match)) {
                $items[$match[1]] = $match[2];
            }
        }
    }
    $text = _substr($text, $StartPos, $EndPos - $StartPos);
    if (_strpos($text, '[CDATA[') == false) {
        $text = str_replace('&lt;', '<', $text);
        $text = str_replace('&gt;', '>', $text);
        $text = str_replace('&amp;', '&', $text);
        $text = str_replace('&quot;', '"', $text);
    } else {
        $text = str_replace('<![CDATA[', '', $text);
        $text = str_replace(']]>', '', $text);
    }
    $items['data'] = trim($text);
    return $items;
}
開發者ID:phannack,項目名稱:GCMS,代碼行數:32,代碼來源:reader.php

示例8: strpos

 /**
  * Finds position of first occurrence of a UTF-8 string. This is a
  * UTF8-aware version of [strpos](http://php.net/strpos).
  *
  *     $position = UTF8::strpos($str, $search);
  *
  * @author  Harry Fuecks <hfuecks@gmail.com>
  * @param   string  $str    haystack
  * @param   string  $search needle
  * @param   integer $offset offset from which character in haystack to start searching
  * @return  integer position of needle
  * @return  boolean FALSE if the needle is not found
  * @uses    UTF8::$server_utf8
  */
 public static function strpos($str, $search, $offset = 0)
 {
     if (UTF8::$server_utf8) {
         return mb_strpos($str, $search, $offset, Kohana::$charset);
     }
     if (!isset(self::$called[__FUNCTION__])) {
         require Kohana::find_file('utf8', __FUNCTION__);
         // Function has been called
         self::$called[__FUNCTION__] = TRUE;
     }
     return _strpos($str, $search, $offset);
 }
開發者ID:BenjaminRomeo,項目名稱:KohanaTest,代碼行數:26,代碼來源:UTF8.php


注:本文中的_strpos函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。