Skip to content

Instantly share code, notes, and snippets.

@immanuelsun
Created March 13, 2016 22:44
Show Gist options
  • Select an option

  • Save immanuelsun/b9e85acbd880d9d49658 to your computer and use it in GitHub Desktop.

Select an option

Save immanuelsun/b9e85acbd880d9d49658 to your computer and use it in GitHub Desktop.

Revisions

  1. immanuelsun created this gist Mar 13, 2016.
    8 changes: 8 additions & 0 deletions php-strip_zeros_from_date.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    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;
    }