Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Making Dynamic Text With PHP and HTML

I have a question, I am making some sort of personal assistant site for school and stuff.
I am very new to PHP and I want that the homepage displays;
‘Goodmorning Reno!’

I got that already but now I want to make it dynamic so when it is Morning it says; Goodmorning and if it is Noon it says; Good afternoon.

My question is how do I do this because im at a loss.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

And if it is not possible than I would love other ideas.

Thanks,

Reno

>Solution :

This code i think thath will help you, if i current understand

code:

<?php
$hour = date('H');
if($hour >= "13"){
    echo("Goodafternoon Reno!");
}else{
    echo("Goodmorning Reno!");
}
?>

You can change the time slot by simply changing the value in the if

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading