Skip to content

Instantly share code, notes, and snippets.

David Strencsev PhiSYS

  • Cartagena, Spain
Block or report user

Report or block PhiSYS

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@PhiSYS
PhiSYS / spintax.php
Last active Jul 8, 2019 — forked from irazasyed/spintax.php
PHP: Text Spinner Class - Nested spinning supported.
View spintax.php
<?php
/**
* Spintax - A helper class to process Spintax strings.
* @name Spintax
* @author Jason Davis - https://www.codedevelopr.com/
* Tutorial: https://www.codedevelopr.com/articles/php-spintax-class/
* Modified by Mark Larsen:
* Added ability so that a fixed output can be returned.
* Modified by David Strencsev:
* Refactor and regular expression lazy optimization.
@PhiSYS
PhiSYS / roundcent.php
Created Sep 5, 2014
Swedish rounding for money values
View roundcent.php
/**
* Swedish rounding $nearest
*
* @param float $num
* @param float $nearest
* @return float
*/
function roundcent($num, $nearest = .05){ // default 5 cent
return round($num / $nearest) * $nearest;
}
@PhiSYS
PhiSYS / int2letters.php
Created Sep 5, 2014
Positive integer encoding as uppercase letters
View int2letters.php
/**
* Encode positive integers as upper case (ASCII) letters
* Encodes 0 as A, 25 as Z, 26 as AA, 51 as AZ, 52 as BA, 701 as ZZ, 702 as AAA... and so on
* @param int $int
* @return string
*/
function int2letters($int) {
$letters = '';
You can’t perform that action at this time.