Пример #1
0
 /**
  * Replaces text within a portion of a UTF-8 string.
  * @see http://php.net/substr_replace
  *
  * @author  Harry Fuecks <*****@*****.**>
  *
  * @param   string   input string
  * @param   string   replacement string
  * @param   integer  offset
  * @return  string
  */
 public static function substr_replace($str, $replacement, $offset, $length = NULL)
 {
     if (!isset(self::$called[__FUNCTION__])) {
         require SYSPATH . 'core/utf8/' . __FUNCTION__ . EXT;
         // Function has been called
         self::$called[__FUNCTION__] = TRUE;
     }
     return _substr_replace($str, $replacement, $offset, $length);
 }
Пример #2
0
 public static function substr_replace($str, $replacement, $offset, $length = NULL)
 {
     if (!isset(UTF8::$called[__FUNCTION__])) {
         require JsonApiApplication::find_file("utf8", __FUNCTION__);
         // Function has been called
         UTF8::$called[__FUNCTION__] = TRUE;
     }
     return _substr_replace($str, $replacement, $offset, $length);
 }
Пример #3
0
 /**
  * Replaces t'.php' within a portion of a UTF-8 string.
  * @see http://php.net/substr_replace
  *
  * @author  Harry Fuecks <*****@*****.**>
  *
  * @param   string   input string
  * @param   string   replacement string
  * @param   integer  offset
  * @return  string
  */
 public static function substr_replace($str, $replacement, $offset, $length = NULL)
 {
     require_once dirname(__FILE__) . '/' . __FUNCTION__ . '.php';
     return _substr_replace($str, $replacement, $offset, $length);
 }
Пример #4
0
 /**
  * Replaces text within a portion of a UTF-8 string
  *
  * This is a UTF8-aware version of [substr_replace](http://php.net/substr_replace).
  *
  * If `$length` given and is positive, it represents the length of the portion of `$str`
  * which is to be replaced. If it is negative, it represents the number of characters
  * from the end of `$str` at which to stop replacing. If it is not given, then it will default
  * to strlen(`$str`); i.e. end the replacing at the end of `$str`. Of course, if `$length` is zero
  * then this function will have the effect of inserting `$replacement` into `$str` at the given start `$offset`.
  *
  * Example:
  * ~~~
  * $str = UTF8::substr_replace($str, $replacement, $offset);
  * ~~~
  *
  * @author  Harry Fuecks <*****@*****.**>
  *
  * @param   string   $str          Input string
  * @param   string   $replacement  Replacement string
  * @param   integer  $offset       Offset
  * @param   mixed    $length       The length of the portion of $string which is to be replaced [Optional]
  *
  * @return  string
  *
  * @uses    Kohana::find_file
  */
 public static function substr_replace($str, $replacement, $offset, $length = NULL)
 {
     UTF8::_load(__FUNCTION__);
     return _substr_replace($str, $replacement, $offset, $length);
 }
Пример #5
0
 /**
  * Replaces text within a portion of a UTF-8 string. This is a UTF8-aware
  * version of [substr_replace](http://php.net/substr_replace).
  *
  *     $str = UTF8::substr_replace($str, $replacement, $offset);
  *
  * @author  Harry Fuecks <*****@*****.**>
  *
  * @param   string  $str         input string
  * @param   string  $replacement replacement string
  * @param   integer $offset      offset
  *
  * @return  string
  */
 public static function substr_replace($str, $replacement, $offset, $length = null)
 {
     if (!isset(UTF8::$called[__FUNCTION__])) {
         require Kohana::find_file('utf8', __FUNCTION__);
         // Function has been called
         UTF8::$called[__FUNCTION__] = true;
     }
     return _substr_replace($str, $replacement, $offset, $length);
 }
Пример #6
0
 /**
  * Replaces text within a portion of a UTF-8 string. This is a UTF8-aware
  * version of [substr_replace](http://php.net/substr_replace).
  *
  *     $str = UTF8::substr_replace($str, $replacement, $offset);
  *
  * @author  Harry Fuecks <*****@*****.**>
  * @param   string  $str            input string
  * @param   string  $replacement    replacement string
  * @param   integer $offset         offset
  * @return  string
  */
 public static function substr_replace($str, $replacement, $offset, $length = NULL)
 {
     if (!isset(self::$called[__FUNCTION__])) {
         require Kohana::find_file('utf8', __FUNCTION__);
         // Function has been called
         self::$called[__FUNCTION__] = TRUE;
     }
     return _substr_replace($str, $replacement, $offset, $length);
 }