w3lifer / php-helper
PHP Helper
Installs: 16 242
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- ext-fileinfo: *
- ext-mbstring: *
- ext-simplexml: *
- ext-zip: *
Requires (Dev)
- phpunit/phpunit: ^9.6
README
Installation
composer require w3lifer/php-helper
Usage
Methods
addPrefixToArrayKeys(array $array, string $prefix, bool $recursively = true): array; addPostfixToArrayKeys(array $array, string $postfix, bool $recursively = true): array; addZeroPrefix(string $value, int $order = 1): string; arrayToXml(array $data, SimpleXMLElement &$xmlData = null): string; auth(array $credentials): bool; clearAllCookies(): bool; createSqlValuesString(array $values, string $valueWrapper = '"'): string; csvStringToArray(string $csvString, bool $removeFirstLine = false): array; filterListOfArraysByKeyValuePairs(array $inputArray, array $searchParams): array; getBase64Image(string $absolutePathToImage): string; getClassNameFromObject(object $object): string; getClassNameFromString(string $className): string; getDatesBetweenDates(string $startDate, string $endDate, string $format = 'Y-m-d'): array; getFilesInDirectory(string $pathToDirectory, bool $recursively = false, array $fileExtensions = [], &$result = []): array; getFullUrl(): string; getNormalizedDayOfWeek(int $dayOfWeek): int; getRandomWeightedElement(array $weightedValues); getResponseHeader(string $header, array $response): string; getTimezoneOffset(string $timeZone): int; insertAfterKey(array $array, string $afterKey, string $key, string $new); isAjax(): bool; mbUcfirst(string $string): string; prettyVarExportSoft(array $array): string; prettyVarExportHard(array $array): string; putArrayToCsvFile(string $filename, array $array): bool; quickSort(array $array): array; rangeGenerator(int $start, int $limit, int $step = 1): Generator; removeCookie(string $name): bool; removeDirectoryRecursively(string $pathToDirectory): bool; removeDuplicatesFromMultiDimensionalArray(array $array): array; secondsToTime(int $seconds): array; sortByDate(array $array, string $key, bool $asc = true): array; strRepeatWithSeparator(string $input, int $multiplier, string $separator = ''): string; tabDelimitedStringToArray(string $string): array; unzip(string $pathToArchive, string $extractTo);
Tests
make tests