Skip to content

Instantly share code, notes, and snippets.

View dapepe's full-sized avatar

Peter Haider dapepe

View GitHub Profile
@dapepe
dapepe / array.check.php
Created February 4, 2014 09:14
Checks if an array is associative or numeric
<?php
/**
* Checks if an array is associative or numeric
*
* @param array $arr
*/
function isAssoc($arr) {
return is_array($arr) ? (array_keys($arr) !== range(0, count($arr) - 1)) : false;
}
@dapepe
dapepe / array.sort.php
Created February 4, 2014 09:13
Sort an array by key
<?php
/**
* Sorts an array by key
*
* @param array $arrData
* @param string $strKey
* @param bool $bolAsc
*/
function sortArray($arrData, $strKey, $bolAsc=true) {
@dapepe
dapepe / excel.utils.php
Last active July 14, 2023 17:28
Utility functions to parse and generate Excel files using PHPexcel
<?php
/**
* Utility functions to parse and generate Excel files using PHPexcel
*
* @author Peter-Christoph Haider
*/
/**
* Parses an excel file into an array
@dapepe
dapepe / cli.php
Last active April 28, 2017 12:10
Utility functions to work with Command Line Interfaces
<?php
/**
* Utility functions to work with Command Line Interfaces
*
* @author Peter-Christoph Haider
*/
/**
* Initilizes CLI arguements