'How to add font family in variable which prints current date [closed]
How to add font family to my current date
$html = 'Date: '.date("d-m-Y").'
Solution 1:[1]
Welcome, to improve your experience on SO please ask questions in more detail.
From the given info i understand you would like to change the font family on your date, So 9-5-2022 would give me the comic sans font and 10-5-2022 would give the inherit font.
To do this you would need to understand php and use the <style> function.
to give this given example you would need an attribute to read the current date, to do this please go to this site on w3docs after you let the php read the date, use the if else functions to change the styling.
the code should be something like this:
for the css we will use the class "fontdate"
if $currentDate=="2022-5-9")){<style> .fontdate{font-family: comicsans;} else if $currentDate=="2022-5-10")){
<style> .fontdate{font-family: inherit;}
else $currentDate=="2022-5-9")){
<style> .fontdate{font-family: arial;}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gijzy |
