Jun
9
2013
9
2013
Output case sensitive word
A snippet by admin
No Comments
/**
* Function to provide case sensitive context
* Context will always only have suffix for 0 or >2 counts
*
* @access public
* @param int count
* @param string word
* @param suffix
* @return string
*/
function tense( $count = 0, $word, $append = 's' )
{
if( $count == 0 || $count >= 2 )
$return = $word . $append;
else
$return = $word;
return $return;
}
Leave a comment
Recent Snippets
- htaccess : Only allow access to specific wordpress upload types if logged in
- MySQL : Query WordPress Database for Invalid Media Filenames
- PHP : Get Actual IP Address with PHP
- JavaScript : Allow Tab in Textarea
- PHP : Clean sanitized database contents on output
- htaccess : Force www. prefix in URIs
- PHP : Force File Download with Correct Content Type
- Wordpress : Disable upgrade notification