Automatic Image (png or svg) Change to Dates

On our sites, we may sometimes want to change our logo and use different logos on special dates or date ranges.

You can easily do this with the following function.

function logo () {
    $date = date('m-d');
    switch( $date ) {
        case '04-23':
            return 'xLogo.png';
        break;
        
        case '05-19':
            return 'yLogo.png';
        break;
        
        default:
            return 'defaultLogo.png';
        break;
    }
}

echo '<img src="' . logo() . '" />'

That's all, good work

Comments

There are no comments, make the firs comment