Skip to content

Instantly share code, notes, and snippets.

View giovanniramos's full-sized avatar
🖥️
Work Work Work

Giovanni Ramos giovanniramos

🖥️
Work Work Work
View GitHub Profile
@giovanniramos
giovanniramos / gist:1483817
Last active September 28, 2015 19:08
Converts a string. Useful functions in slug
<?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)
@giovanniramos
giovanniramos / gist:1478921
Last active September 28, 2015 18:27
Makes converting with date/datetime (BR <=> U.S.)
<?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')
@giovanniramos
giovanniramos / gist:907912
Created April 7, 2011 14:50
This function converts a full name for UTF-8 ignoring certain prepositions.
<?php
/**
* getFullName ()
*
* This function converts a full name for UTF-8 ignoring certain prepositions.
*
* @author Giovanni Ramos
*
* @param string $fullName
* @return string
@giovanniramos
giovanniramos / createColsOf.php
Created January 7, 2011 20:35
Function that generates a list, with their surround option, by columns argument.
<?php
/**
* createColsOf ()
*
* Function that generates a list, with their surround option, by columns argument.
*
* @author Giovanni Ramos
* @todo add more options.
*
* @param array $vars