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
Popular Articles
Popular Tags
- #directive
- #Function
- #React
- #Class
- #centOS
- #Json
- #Text
- #API
- #URL
- #Encrypting
- #Redirect
- #Form
- #Special Characters
- #Special
- #Random
- #Generating
- #SASS
- #Version
- #Installation
- #Show
- #
- #Ajax
- #method
- #Logic For Displaying Posts
- #Key
- #DDOS
- #Default Value
- #Comment Line
- #1364 Field
- #Error
- #Abbreviation
- #QR Code Generating
- #Date
- #timeAgo
- #cURL
- #Array
- #Arrays with Key Values to String Statement
- #Short Tag
- #Vite
- #Reading Excel Files
- #Activate
- #Reading
- #Composer
- #Autoloader
- #PSR-4
- #Insert
- #Record
- #Real Time
- #Characters
- #Socket.io
There are no comments, make the firs comment