Exercise Using PHP | Scheduled Message Programming | PHP Tutorial | Learn PHP Programming. In this PHP tutorial you will do a short exercise where we use some of the knowledge we have gathered from previous episodes. The primary reason behind this exercise, is to show how we can use what we have learned so far, to build an actual PHP application on our website.
w3schools date parameters:
http://www.w3schools.com/php/func_date_date.asp
➤ GET ACCESS TO MY LESSON MATERIAL HERE!
First of all, thank you for all the support you have given me!
I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!
I am now using Patreon to share improved and updated lesson material, and for a small fee you can access all the material. I have worked hard, and done my best to help you understand what I teach.
I hope you will find it helpful 🙂
Material for this lesson: https://www.patreon.com/posts/php-16-download-15610162
Amazon Auto Links: No products found.
Thanks Dude , I have actually watching all your video , Thanks for sharing this to the other people around the globe, actually i did not any knowledg about Php i am now confident Thanks again and again , hello from Somalia
You make a good teacher. I understood this right off the bat.
Still following and loving your PHP courses! Any chance you could create a tutorial on how to build an up-to-date website, with a login system and a members area? I cannot find ANYTHING online that is up-to-date on how to do this with PHP.
I have a doubt,we could’ve used if else statements to determine the day,for example if $dayofweek == 5 or 6,i’m not saying this method is wrong,i just want to know why we did not use the alternative.
$dayofweek = date(‘l’);
“Today is $dayofweek”;
Haha same here, it’s Friday
its local time or server time ?
Even though today(7/16/18) is Monday, the date() function states that it is Tuesday. Any thoughts as to why? Does it have anything to do with GMT? I live on the East Coast of the US.
Thanks many many thanks . Excellent as usual . I have a question . May you help me why my css style does not work ?
css code :
p{
text-align:center;
font-size: 120px;
font-family: Arial;
margin-top:38vh;
}
php code :
< !DOCTYPE html>
< ?php $dofw=date("l"); echo $dofw; switch($dofw) { case 1: echo "It is Monday"; break; case 2: echo "It is Tuesday"; break; case 3: echo "It is Wednesday"; break; case 4: echo "It is Thursday"; break; case 5: echo "It is Friday"; break; case 6: echo "
It is Saturday“;
break;
case 0:
echo “It is Sanday”;
break;
}
Im back this my 2nd day
use < ?php $date = date("N"); //it do count from 1 instead "w" parameter that count from 0;?>
Notice: Undefined variable: dayofweek in C:xampphtdocscasharadaindex.PHP on line 19
Notice: Undefined variable: dayofweek in C:xampphtdocscasharadaindex.PHP on line 24
Notice: Undefined variable: dayofweek in C:xampphtdocscasharadaindex.PHP on line 28
Notice: Undefined variable: dayofweek in C:xampphtdocscasharadaindex.PHP on line 32
Notice: Undefined variable: dayofweek in C:xampphtdocscasharadaindex.PHP on line 36
Notice: Undefined variable: dayofweek in C:xampphtdocscasharadaindex.PHP on line 40
Notice: Undefined variable: dayofweek in C:xampphtdocscasharadaindex.PHP on line 44
it is sunday!
when i run this errors are coming how can i solve… reply me please if you can..
very interesting introduction to basic calculator in php. But how can I use this idea to calculate taxation values in Laravel?. Need Your guide please. Thanks in advance
Actually forgot that you mention it was Friday. So I added the Page tags
to Friday, and not Monday of which it is today. After adding the P tag to each day it worked as yours does.
Hey mmtuts (sorry, I don’t think you say your name in any of the vids I’ve seen LOL).
First of all, I wanna say how excellent your tutorials are. I’ve only watched the PHP ones so I can’t speak for the others, but these are amazing. You know how many “tutorials” out there fail to explain things properly? 99%. Yes, 99%. You know how many fail to actually show you HOW do to things? 99%. Yes, 99%. You know how many fail to show you HOW to do things && explain them well? Yup. You are in the 1% of the 1%. It’s such a shame you’re not getting more views on these. With the quality of your presentation, I expected to see views of 50k+. Keep at it, man. Word will get out and they will pay off eventually. There is a serious shortage of quality instructors on the net so it’s only a matter of time.
After all that, I do have a question. LOL
When I did this, I got “5” for Friday. But it’s Thursday. So I tried “d” and I got “02”, but it’s December 1st, not 2nd. My first thought was that maybe my server is in a different time zone. Oh no, I’m using localhost on WAMP. lol. Could my VPN be responsible? Shouldn’t. I’m connected to New York right now and it’s the same time there as here. Check system time and date and it’s all accurate.
So what could be causing the date(“w”) function to be returning the wrong result?
Please upload on ubuntu OS too…U are very good teacher
it would have being better to use an array insted. Like this:
$weekday = array(“Sunday”, “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday” );
$dayofweek = date(“w”);
echo “Today is “.$weekday[$dayofweek];
I’m definitely sharing these with everyone man, kudos to you
man u are god
Very unnecessary way of figuring day of the week out. The date function has that already built in. Just do: < ?php echo date('l');?>
Done.
In atom opened new .less stylesheet is that ok or how do i make a .css one?
Thanks for this. Now having this running WITH a background :). I’m currently following the whole course. Although i’m familiar with the basics, there might be something i didn’t know!
Keep going with this. It’s very n00b friendly and i’m enjoying this content.
ITs Friday for me too !! 😀
i think may be use array to do this is better
It’s Tuesday!
Thank you . Your video make me to be alive with my job. I have a question that What did you use for style is it java script or css ?
If there are more than one files in phptutorials (as in yours) then how can it work??
You can just do:
< ?php echo "
This is “.date(‘l’).”“;
Sir , i write every single code as it is yours , but i got blank screen , dint get any text as my answer, i hope you will solve my problem…
You are EXCELLENT!!!!!
I’m learning so much in a short amount of time.
hy you are my hero I deeply appreciate your awesome videos… thanks A lot.
It’s Friday for me too! Lucky?