Created
March 13, 2016 22:44
-
-
Save immanuelsun/b9e85acbd880d9d49658 to your computer and use it in GitHub Desktop.
PHP: strip zeros from `date()`.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function strip_zeros_from_date($marked_string = "") | |
{ | |
// remove the marked zeros | |
$no_zeros = str_replace("*0", "", $marked_string); | |
// remove any remaining zeros | |
$cleaned_string = str_replace("*", "", $no_zeros); | |
return $cleaned_string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment