Skip to content

Instantly share code, notes, and snippets.

@giovanniramos
Last active December 18, 2015 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giovanniramos/5716880 to your computer and use it in GitHub Desktop.
Save giovanniramos/5716880 to your computer and use it in GitHub Desktop.
Converts a character from a colon to HTML
<?php
/**
* Converts a character from a colon to HTML
*
* @param string $value The input string
* @return string
* @link https://gist.github.com/5716880
*
* */
function htmlColon($value)
{
$value = preg_replace('~[:]~', '&#58;', htmlentities($value));
return $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment