[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/string/src/phputf8/ -> substr_replace.php (source)

   1  <?php
   2  /**
   3  * @package utf8
   4  */
   5  
   6  //---------------------------------------------------------------
   7  /**
   8  * UTF-8 aware substr_replace.
   9  * Note: requires utf8_substr to be loaded
  10  * @see http://www.php.net/substr_replace
  11  * @see utf8_strlen
  12  * @see utf8_substr
  13  */
  14  function utf8_substr_replace($str, $repl, $start , $length = NULL ) {
  15      preg_match_all('/./us', $str, $ar);
  16      preg_match_all('/./us', $repl, $rar);
  17      if( $length === NULL ) {
  18          $length = utf8_strlen($str);
  19      }
  20      array_splice( $ar[0], $start, $length, $rar[0] );
  21      return join('',$ar[0]);
  22  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer