public static function PHPExcel_Calculation_TextData::SEARCHINSENSITIVE in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/TextData.php \PHPExcel_Calculation_TextData::SEARCHINSENSITIVE()
* SEARCHINSENSITIVE * *
Parameters
string $needle The string to look for: * @param string $haystack The string in which to look * @param int $offset Offset within $haystack * @return string
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Calculation/ TextData.php, line 268
Class
- PHPExcel_Calculation_TextData
- PHPExcel_Calculation_TextData
Code
public static function SEARCHINSENSITIVE($needle, $haystack, $offset = 1) {
$needle = PHPExcel_Calculation_Functions::flattenSingleValue($needle);
$haystack = PHPExcel_Calculation_Functions::flattenSingleValue($haystack);
$offset = PHPExcel_Calculation_Functions::flattenSingleValue($offset);
if (!is_bool($needle)) {
if (is_bool($haystack)) {
$haystack = $haystack ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
}
if ($offset > 0 && PHPExcel_Shared_String::CountCharacters($haystack) > $offset) {
if (PHPExcel_Shared_String::CountCharacters($needle) == 0) {
return $offset;
}
if (function_exists('mb_stripos')) {
$pos = mb_stripos($haystack, $needle, --$offset, 'UTF-8');
}
else {
$pos = stripos($haystack, $needle, --$offset);
}
if ($pos !== false) {
return ++$pos;
}
}
}
return PHPExcel_Calculation_Functions::VALUE();
}