Add CSV-export of local records

This commit is contained in:
Alexander Nell
2020-05-18 08:46:19 +02:00
parent 0148923268
commit 50408c75f6
2 changed files with 95 additions and 0 deletions

View File

@ -63,6 +63,32 @@ abstract class DataUtil {
}
}
/**
* Checks, if a string ends with the given substring.
* @param string $haystack
* @param string $needle
* @return bool
*/
public static function endsWith($haystack, $needle) {
$length = strlen($needle);
if ($length == 0) {
return true;
}
return (substr($haystack, -$length) === $needle);
}
/**
* Checks, if a string starts with the given substring.
* @param string $haystack
* @param string $needle
* @return bool
*/
public static function startsWith($haystack, $needle) {
$length = strlen($needle);
return (substr($haystack, 0, $length) === $needle);
}
/**
* Implodes sub-arrays with position properties.
*