@@ 206-230 (lines=25) @@ | ||
203 | * |
|
204 | * @return string |
|
205 | */ |
|
206 | public static function SEARCHSENSITIVE($needle, $haystack, $offset = 1) |
|
207 | { |
|
208 | $needle = Functions::flattenSingleValue($needle); |
|
209 | $haystack = Functions::flattenSingleValue($haystack); |
|
210 | $offset = Functions::flattenSingleValue($offset); |
|
211 | ||
212 | if (!is_bool($needle)) { |
|
213 | if (is_bool($haystack)) { |
|
214 | $haystack = ($haystack) ? \PhpOffice\PhpSpreadsheet\Calculation::getTRUE() : \PhpOffice\PhpSpreadsheet\Calculation::getFALSE(); |
|
215 | } |
|
216 | ||
217 | if (($offset > 0) && (\PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($haystack) > $offset)) { |
|
218 | if (\PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($needle) == 0) { |
|
219 | return $offset; |
|
220 | } |
|
221 | ||
222 | $pos = mb_strpos($haystack, $needle, --$offset, 'UTF-8'); |
|
223 | if ($pos !== false) { |
|
224 | return ++$pos; |
|
225 | } |
|
226 | } |
|
227 | } |
|
228 | ||
229 | return Functions::VALUE(); |
|
230 | } |
|
231 | ||
232 | /** |
|
233 | * SEARCHINSENSITIVE. |
|
@@ 241-265 (lines=25) @@ | ||
238 | * |
|
239 | * @return string |
|
240 | */ |
|
241 | public static function SEARCHINSENSITIVE($needle, $haystack, $offset = 1) |
|
242 | { |
|
243 | $needle = Functions::flattenSingleValue($needle); |
|
244 | $haystack = Functions::flattenSingleValue($haystack); |
|
245 | $offset = Functions::flattenSingleValue($offset); |
|
246 | ||
247 | if (!is_bool($needle)) { |
|
248 | if (is_bool($haystack)) { |
|
249 | $haystack = ($haystack) ? \PhpOffice\PhpSpreadsheet\Calculation::getTRUE() : \PhpOffice\PhpSpreadsheet\Calculation::getFALSE(); |
|
250 | } |
|
251 | ||
252 | if (($offset > 0) && (\PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($haystack) > $offset)) { |
|
253 | if (\PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($needle) == 0) { |
|
254 | return $offset; |
|
255 | } |
|
256 | ||
257 | $pos = mb_stripos($haystack, $needle, --$offset, 'UTF-8'); |
|
258 | if ($pos !== false) { |
|
259 | return ++$pos; |
|
260 | } |
|
261 | } |
|
262 | } |
|
263 | ||
264 | return Functions::VALUE(); |
|
265 | } |
|
266 | ||
267 | /** |
|
268 | * FIXEDFORMAT. |