This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* createColsOf () | |
* | |
* Function that generates a list, with their surround option, by columns argument. | |
* | |
* @author Giovanni Ramos | |
* @todo add more options. | |
* | |
* @param array $vars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* getFullName () | |
* | |
* This function converts a full name for UTF-8 ignoring certain prepositions. | |
* | |
* @author Giovanni Ramos | |
* | |
* @param string $fullName | |
* @return string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Makes converting with date/datetime (BR <=> U.S.) | |
* | |
* @param string $value The date or datetime | |
* @param string $type Format types: datetime, date, time | |
* @return string | |
* | |
* */ | |
function swapDatetime($value, $type = 'datetime') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Converts a string. Useful functions in slug | |
* | |
* @param string $string The input string | |
* @param string $mode OPTIONAL Conversion Formats: Lower (Everything to lowercase), Upper (Everything to uppercase) | |
* @return string | |
* | |
* */ | |
function normalize($string, $mode = null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Checks if a value exists in an array | |
* | |
* @param mixed $needle The value sought | |
* @param array $haystack The array that will be verified | |
* @return boolean | |
* | |
* */ | |
function in_multiarray($needle, $haystack) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Checks through recursion, a list of keys that have a value EMPTY or NULL | |
* | |
* @param array $haystack A simple/multi-dimensional array | |
* @param string $mandatory List with the names of keys that will be checked, separated by commas | |
* @return boolean | |
* | |
* */ | |
function is_arrayEmpty($haystack, $mandatory = null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Removes the style markup in html tags, derived from a text editor | |
* | |
* @param string $value The input string | |
* @return string | |
* @link https://gist.github.com/3078188 | |
* | |
* */ | |
function clearStyle($value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returns the sum of occurrences, in an array of a given condition satisfied | |
* | |
* @param mixed $value The value or array to be evaluated | |
* @param string $operator Operator of evaluation | |
* @param string $conditional Conditional assignment | |
* @return integer | |
* @link https://gist.github.com/3100679 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* get_called_class < 5.3 [solution] | |
* | |
*/ | |
function get_called_class() | |
{ | |
$objects = array(); | |
$traces = debug_backtrace(); |
OlderNewer