Skip to content

Instantly share code, notes, and snippets.

View kristos80's full-sized avatar
💭
It's not a bug, it's a feature!

Christos Athanasiadis kristos80

💭
It's not a bug, it's a feature!
View GitHub Profile
@kristos80
kristos80 / quine.php
Last active April 8, 2021 14:52
Implementation of a quine program in PHP
<?=file_get_contents(__FILE__)?>
@kristos80
kristos80 / mask-string.php
Last active November 23, 2023 13:01
Generic utility method in PHP to mask a string with a specific character. Can be used for password masking eg
<?php
/**
* Generic utility method to mask a string with a specific character
*
* @param string $stringToMask The string to be masked
* @param int $percentageOfCharactersToShow What percentage of characters to show. Default = 20%
* @param string $maskCharacter With which character to mask. Default = '*'. If more characters are used, only the first will be used as mask
* @param bool $maskFromStart From which direction to start masking. TRUE = From start, FALSE = From the end
* @return string
*/