Well, considering I'm currently in an internship and trying to catch up to my mentors, this series is an absolute gold mine. One of my mentors recommended it and I couldn't be more satisfied by it. Thank you for the invaluable work you put into this!
This is the third tutorial I'm on, and I had to quit the other two (which are supposedly for beginners), because of deprecated code and no fix for the problems. One thing I wondered was why there was no php closing tag used. Nobody ever explained it. You are the FIRST to actually explain why! Thank you!!!
It's one of the reasons why I made this course and put in so much effort. Glad you like it and find it useful, feel free to ask any questions as you are going through the course 🙌
The best explanation way I have ever attended on UA-cam, a lot of information that I did not find in another youtube channel, I really like your way of explanation. Thank you, Gio.
I have been developing in PHP for some years . . . and didn't know about ONLY have an opening PHP tag, for files that ONLY contain PHP. A great tutorial.
php file: If you want your file to be interpreted as php then your file must end with that php and not with that html. php files can also have html, CSS, JavaScript in them. php tag: php opening and closing tag is and php interpreter interpreted the code between opening and closing tag. But if your file entirely contain 100 percent php code then you do not need the closing tag and that is to make sure that no accidental whitespace or new lines are added after the php closing tag which could mess up your website. Semicolon: php closing tag will automatically assume the semicolon on the last line. So basically you do not need semicolon the Last line of php statement. This is useful when you are embedding php with html and it's just a single line in those case s you do not need the semicolon but if you have multiple lines though it's a good idea to stay consistent and just use the semicolon. php code execute: You could execute your php script within your terminal. If you open xampp control panel and click on shell on here this will bring up the terminal. We need to cd into our project directory which is htdocs program with project name and then you could run php files using the php command and that will give you the output. So you could basically execute your php code in command line if you want. You could also use print to print something which essentially is the same thing as echo. Difference of echo and print: Print has a return value of 1 for that reason here I give an example like I do echo and then print that will print out hello world and then append one at the end because this expression itself return 1 this means that print could be used within expressions while echo can not for example if we did this the other way print echo "hello world" and this would not work and we would get the syntax error. Echo could print multiple values while print can not. for example echo "abc", "xyz";//works print "abc", "xyz";//does not works Echo is marginally faster than print. variable Vraible declared with dollar sign($).First character start with a-zA-Z_ and then other character from a-zA-Z_0-9.No space and no special character are allowed. This is a object so you do not assign $this. Variables in php are by default assign by value .Let me show you what I mean so if we have a variable called x which equals to 1and then we have a variable y which equals o x and then we change the value of x to 3 and then we print y what will be printed is 1 and not 3 that is because variables are assigned by value.On the other handif you actually wanted y to change whatever x cahnges then we need to assign variables by reference instead of value. Assign a variable by reference,you need to add ampersand righ here so now y is equal to reference variable x so anytime x cahnges the y will also change and now y is equal to 3. Comments: There are two types of single line comments that are // your comments and #your comments. Multiline comments is /* comment here */. Nested multiple comments are not allowed.
Great Video and great Tutorial Gio! I have a bit knowledge about PHP but I guess with this tutorial series I could dive a bit deeper. I have heard many people telling that they use echo in php or that echo is better than print and I already knew the different behaviour in most cases. But noone by now told me that echo is faster. I immediately programmed a small test: With 500.000.000 function calls I was able to examine a 2-3% time effort. So, you are right, it is faster but I guess that should not matter in a normal project. Still it is true to use the functions / tools you really need and not those that do extra stuff you ignore anyways. But I guess that might be more important for more complex functions and when using any framework, there runs so much extra effort in the background that I doubt that echo/print makes a big difference. But still thank you soo much as I now KNOW why I always use echo although I was so familiar with print from C-times 🙂
I will follow your actual Laravel course after finishing this one. And after this I hope you will do an update on this course again 🙂If you consider that, I might have something for you: While testing, I compared single versus double quotes as well and I was astonished as double quotes were 20% - 33% slower than single quotes. Although these tests were not really representative as I only used 150 Million calls and due to the extreme fast calculation time of each single echo/print other factors like Server related delays might have had huge side effects. But still I guess its even more important to use single quotes instead of double quotes than to use echo instead of print whenever you don't need the other one explicitly. Maybe I will do more runtime tests like this 🙂
@@ProgramWithGio I wonder why in so many areas in programming time doesn't make a difference anymore. I can remember the discussions when there were those only programming with C as it always produced the fastets result and those that called C a dead language as the process of programming itself became that easier and faster with new languages. Yes the machines became much faster and were capable to handle "slow" code. But we now are in times where the apps with AI and deep thought become that complex that the small parts - as you mention - 'add up' drastically. I currently think about a project enabling an AI to change/reprogram itself with the force to switch between different languages and the ability to self-driven comparison of different ways and attitudes based on situation, aim and given ressources. But I know its too high goal for a single person project and as I am not professional programmer I guess I have to wait for a company that has these goals and wants noobs like me for their team just for the ideas 🙂
Many jobs opportunities using PHP from where I am located. I was learning Node.js and I will still practice it but I feel like I should learn PHP and not pay attention to those who say that PHP is dead.
Hi Gio. Nice videos. I created php functions to be used to generate dynamic html but i feel is the wrong practice. I watched your videos on slim and twig but couldnt wrap my head around so im using php template for the view rendering. Is there a way i can use slim php with React (acting as the dynamically generated html for the views) where if render view eg home.php with some fetched db data the React takes the $data which I'd json encode in the home.php view and pass it as a prop to a React component to dynamic generate the views. In short how can i merge slim php with react
You can use PHP with React but you would need to use PHP as an API layer and pass data to your react via ajax calls. Its a bit complicated to set it up but its certainly possible. You can look into Inertia.js for Laravel which allows you to pass down to react components directly from controllers similar to how you would pass it down to regular views
Hello. You can slow it down by clicking on the ⚙️ icon and set playback speed to 0.75x or 0.5x. I apologize if it's too fast, I've made some editing mistakes where I cut out all empty spaces.
Help me please! When i ran programm on VS code notification comes out: 'PHP executable not found. Install PHP and add it to your PATH or set the php.debug.executablePath setting'. What can i do with that?
How is your PHP installed? I dont use vscode so Im not sure how its configured there but it simply means it is looking for php executable and cant find it, if you are running php through wsl2/docker then you need to select php executable from there
Hi Gio, one thing about the semicolon, I saw in following videos that when you declare function or classes you don't use the semicolon at the end, why that? Isn't it an end of a statement?Indeed if I put it in those occasions it seems that the script doesn't work, I'm quite confused.
Hey, you don't need semicolon at the end of }. Can you point me to timestamp on the video on what part you are referring to? You don't need semicolon on single line expressions like this
@@ProgramWithGio I didn't mean u put semicolon at the end of }, I was askin' why is that in general. "Hey, you don't need semicolon at the end of }" --->why is that? I can't understand where to put semicolons exactly. I meant that in following videos of yours there were (indeed) no semicolon at the end of } but I cannot understand why if we're saying that we must put them after every statement. There were something like this(but also seeing other codes):
@@rosarioveneruso9928 } on its own is not a statement so yea you don't put a semicolon there. It's just a closing bracket. If that were case then you would need to put semicolon at the end of each line including the if() {. P.S. I don't think the above code is from my lesson.
@@ProgramWithGio It isn't , i was just an example(i wrote "somethin' like"), the point was that it wasn't clear to me when/where put semicolon. "} on its own is not a statement so yea you don't put a semicolon there" I meant the two brackets with what is inside of it, don't we count that as a statement? The block inside of it is not a/a series of instruction/s?
@@rosarioveneruso9928 I would watch lesson about expressions in this series, it might help. You just don't put semicolons at the end of brackets, idk if there is a list of things that you can't put semicolons on but that's one of them. Whatever is contained within control block (within brackets) at the end of those lines you put semicolon, they are usually expressions.
How to make errors to appear in a browser? I've edited php.ini file and set error_reporting = E_ALL and display_error = On, but nothing changed. The program is still crashes silently.
although its hard to read your words. I guess you ask if you are late... In regards to the comment: 2 years after the video is late but not too late as I guess, especially as the creator himself replied 🙂 In regards to learning PHP: It's never too late to learn new stuff and PHP is still really active as Gio explained. So I would say no, you are not too late. In the end, I am even later on both points 🙂
I was a bit confused at first until I realized that you do not know the meaning of the symbol quotes in English. ' = apostrophe, " = quotes and "" = double quotes.
Thanks, English isn't my first language, but in PHP we usually call it all quotes (single, double) and saying apostrophe usually confuses people more since most know it as "quotes" and either single or double quote works in most cases.
Srry boys but echo ("Hello {$variable}") is deprecated since php 8 so if you are searching why vscode gives u a warning in this line of code now you know why
Nope, that is not deprecated in PHP 8 and is perfectly valid. Did you define the variable? What error are you getting? Maybe you are referring to PHP 8.2 which deprecates this: "${variable}" but "{$variable}" should still work
@@teacupentertaining6073 I don't see it in the php documentation as being deprecated. You can see here what's deprecated in 8.2: www.php.net/manual/en/migration82.deprecated.php
Well, considering I'm currently in an internship and trying to catch up to my mentors, this series is an absolute gold mine. One of my mentors recommended it and I couldn't be more satisfied by it. Thank you for the invaluable work you put into this!
Thank you & send my thanks to your mentors, really appreciate it 💙
Same 🤭
I highly recommend this video on the Basics of PHP Syntax to total beginners and anyone who lacks a clear starting point, as it is truly helpful.
Thank you 💙
Learning PHP language is very pleasant thanks to this channel.
Glad to hear that, thank you
Huge thanks to Gio for the invaluable knowledge shared in these tutorials!
You're welcome
This will help out beginners immensely, I wish I had these basics when I just started, would've helped me out a lot!
Wow ... the amount of information you have is insane!!! It shows that you really know what you are talking about. Thanks for this valuable series! :D
Thank you. I spend a lot of time preparing videos, I don't know everything by heart :)
These are legit the best coding practices I have ever learned, and you just tackled printing and variables. I'm commited to finish this tutorial :)
Glad you like it, welcome aboard 🙌🙌
This is the third tutorial I'm on, and I had to quit the other two (which are supposedly for beginners), because of deprecated code and no fix for the problems. One thing I wondered was why there was no php closing tag used. Nobody ever explained it. You are the FIRST to actually explain why! Thank you!!!
It's one of the reasons why I made this course and put in so much effort. Glad you like it and find it useful, feel free to ask any questions as you are going through the course 🙌
lots of great stuff, very detailed. you're the best PHP teacher I've ever encountered.
Thank you 🙌
The best explanation way I have ever attended on UA-cam, a lot of information that I did not find in another youtube channel, I really like your way of explanation.
Thank you, Gio.
Thank you 🙏
I have been developing in PHP for some years . . . and didn't know about ONLY have an opening PHP tag, for files that ONLY contain PHP. A great tutorial.
Thank you 💙
That's awesome, I really love your teaching style. Keep up the good work.
Thank you 😊
Hey Gio! You deserve Millions of Subscribers. Keep it up and bring more courses like this 'cause I'm really enjoying this course.
Thank you, I'm glad that you like my tutorials 🙌
I like how you speak slowly and explain everything . I will complete the full course .. Keep up the good work
Thank you 🙌
php file:
If you want your file to be interpreted as php then your file must end with that php and not with that html. php files can also have html, CSS, JavaScript in them.
php tag:
php opening and closing tag is and php interpreter interpreted the code between opening and closing tag. But if your file entirely contain 100 percent php code then you do not need the closing tag and that is to make sure that no accidental whitespace or new lines are added after the php closing tag which could mess up your website.
Semicolon:
php closing tag will automatically assume the semicolon on the last line.
So basically you do not need semicolon the Last line of php statement. This is useful when you are embedding php with html and it's just a single line in those case s you do not need the semicolon but if you have multiple lines though it's a good idea to stay consistent and just use the semicolon.
php code execute:
You could execute your php script within your terminal. If you open xampp control panel and click on shell on here this will bring up the terminal. We need to cd into our project directory which is htdocs program with project name and then you could run php files using the php command and that will give you the output. So you could basically execute your php code in command line if you want.
You could also use print to print something which essentially is the same thing as echo.
Difference of echo and print:
Print has a return value of 1 for that reason here I give an example like
I do echo and then print that will print out hello world and then append one at the end because this expression itself return 1 this means that print could be used within expressions while echo can not for example if we did this the other way print echo "hello world" and this would not work and we would get the syntax error.
Echo could print multiple values while print can not.
for example
echo "abc", "xyz";//works
print "abc", "xyz";//does not works
Echo is marginally faster than print.
variable
Vraible declared with dollar sign($).First character start with a-zA-Z_ and then other character from a-zA-Z_0-9.No space and no special character are allowed. This is a object so you do not assign $this.
Variables in php are by default assign by value .Let me show you what I mean
so if we have a variable called x which equals to 1and then we have a variable y which equals o x and then we change the value of x to 3 and then we print y what will be printed is 1 and not 3 that is because variables are assigned by value.On the other handif you actually wanted y to change whatever x cahnges then we need to assign variables by reference instead of value. Assign a variable by reference,you need to add ampersand righ here so now y is equal to reference variable x so anytime x cahnges the y will also change and now y is equal to 3.
Comments:
There are two types of single line comments that are // your comments and #your comments.
Multiline comments is /* comment here */. Nested multiple comments are not allowed.
wow
Best video ever ❤
Thank you 💙
Very Clear. I liked your introduction and how detailed you are. Starting right at the beginning is frustrating but absolutely necessary as you say
Glad you liked it, thank you 💙
TNice tutorials comnt from you is legendary. Uncomplicated like your video!!!
Glad you like them, thank you 💙
ur the person we need buut dont deserve
💙💙
Wow! I just learned that in PHP variables are assigned by value by default and not by reference 😮
Already seeing some progress, can't wait for more 🎉
Happy to hear, keep going 🙌
Thanks. I didn't know about the reference. Looking forward to finish this amazing course :P
You're welcome. Glad it was useful 🙌
Once again, very clear and nicely explained. Plus, I enjoyed learning the concepts that are not very widely taught in other resources. keep it up! :)
Thank you 🙏
Thank you for this wonderful and very knowledgeable 🙏 PHP learning series.
You're very welcome
Very clear explanation you deserve more audience.
You earned a new subscriber.
Keep up the good work 😍😍
Thank you so much 🙏
Great Video and great Tutorial Gio!
I have a bit knowledge about PHP but I guess with this tutorial series I could dive a bit deeper.
I have heard many people telling that they use echo in php or that echo is better than print and I already knew the different behaviour in most cases. But noone by now told me that echo is faster. I immediately programmed a small test:
With 500.000.000 function calls I was able to examine a 2-3% time effort. So, you are right, it is faster but I guess that should not matter in a normal project. Still it is true to use the functions / tools you really need and not those that do extra stuff you ignore anyways. But I guess that might be more important for more complex functions and when using any framework, there runs so much extra effort in the background that I doubt that echo/print makes a big difference. But still thank you soo much as I now KNOW why I always use echo although I was so familiar with print from C-times 🙂
I will follow your actual Laravel course after finishing this one. And after this I hope you will do an update on this course again 🙂If you consider that, I might have something for you:
While testing, I compared single versus double quotes as well and I was astonished as double quotes were 20% - 33% slower than single quotes. Although these tests were not really representative as I only used 150 Million calls and due to the extreme fast calculation time of each single echo/print other factors like Server related delays might have had huge side effects. But still I guess its even more important to use single quotes instead of double quotes than to use echo instead of print whenever you don't need the other one explicitly. Maybe I will do more runtime tests like this 🙂
Thank you, yea most of those are negligible usually but it can add up
@@ProgramWithGio I wonder why in so many areas in programming time doesn't make a difference anymore. I can remember the discussions when there were those only programming with C as it always produced the fastets result and those that called C a dead language as the process of programming itself became that easier and faster with new languages. Yes the machines became much faster and were capable to handle "slow" code. But we now are in times where the apps with AI and deep thought become that complex that the small parts - as you mention - 'add up' drastically.
I currently think about a project enabling an AI to change/reprogram itself with the force to switch between different languages and the ability to self-driven comparison of different ways and attitudes based on situation, aim and given ressources. But I know its too high goal for a single person project and as I am not professional programmer I guess I have to wait for a company that has these goals and wants noobs like me for their team just for the ideas 🙂
finally i found a good PHP course.
Happy to hear 🙌
learning lots of cool little details here!
Glad to hear that 👍
i have started learning it i will come back when i finish it! 😄
🤞🤞
very good, i'm wathching from Brazil, thank you.....congratulations for your channel!
Thank you & greetings to you my friend, love Brazil (my favorite national football team)
Very useful tutorial to start with PHP. I'm coming from Java world, so it shouldn't be that hard for me to learn php in few months I guess :)
Thank you. Yea if you know Java it shouldnt be that hard
very clear explanation sir
Thank you 🙌
Real Nice!
Liked and subscribed.
Thank you 🙌
thank you very much for this excellent course.
You're welcome 🙌
Perfect explanation 👌
Glad you liked it
Keep up the good work. ❤
Thank you, I'll try my best 👍
Thank you for your great contribution !!
🙌🙌
great tutorial. Thanks
You're welcome
You can also use a period to concatenate a string: $s = "Hello " . "World";
Yup I show that in the video as well.
Very helpful tutorial ❤
💙💙
Many jobs opportunities using PHP from where I am located. I was learning Node.js and I will still practice it but I feel like I should learn PHP and not pay attention to those who say that PHP is dead.
Thats a good strategy, you should go based on demand & if in your location PHP is on demand then it makes sense to learn PHP
U are the best ❤
Thank you
great. thank you.
You're welcome
thank you again
Always welcome
Working on a laravel project and struggling with syntax hope this will help
Hope too
Excellent! Thanks, Gio!
You're welcome
thank you so much
you're welcome
Good for beginners.
Glad you think so
very powerful tutorial :)
great!
Great Master
💙💙
thank you
You're welcome
Realy cool
Thank you
thanks a lot
You are welcome
Hi, there. I am absolutely new in this. I have already installed VSC, is it ok for php? You didn't recommended in the video...
It's fine, I don't use VSC, I use phpstorm but a lot of devs use vscode & I think its fine. It just may not have all the features phpstorm has.
Awesome :)
Thank you. Cheers
Hi Gio. Nice videos. I created php functions to be used to generate dynamic html but i feel is the wrong practice. I watched your videos on slim and twig but couldnt wrap my head around so im using php template for the view rendering. Is there a way i can use slim php with React (acting as the dynamically generated html for the views) where if render view eg home.php with some fetched db data the React takes the $data which I'd json encode in the home.php view and pass it as a prop to a React component to dynamic generate the views. In short how can i merge slim php with react
You can use PHP with React but you would need to use PHP as an API layer and pass data to your react via ajax calls. Its a bit complicated to set it up but its certainly possible. You can look into Inertia.js for Laravel which allows you to pass down to react components directly from controllers similar to how you would pass it down to regular views
@@ProgramWithGio this is great! Thank you, mate.
can i use vs code as IDE while following ur tutorial?
beginner here thank you
You can use any code editor you like
Joel Karr to be fair I learnt loads
Was this directed to me or someone else? Either way, thank you 💙
holy shit you went with php storm. Great software but expensive as heck and probably not something a new user would invest in.
Sure, you can use whatever IDE you want, phpstorm is not a requirement. It's just what I use and am comfortable with
Hi I am a completely beginner for PHP, but the tutorial is really too fast for me :( a bit frustrated
Hello. You can slow it down by clicking on the ⚙️ icon and set playback speed to 0.75x or 0.5x. I apologize if it's too fast, I've made some editing mistakes where I cut out all empty spaces.
Help me please! When i ran programm on VS code notification comes out: 'PHP executable not found. Install PHP and add it to your PATH or set the php.debug.executablePath setting'. What can i do with that?
How is your PHP installed? I dont use vscode so Im not sure how its configured there but it simply means it is looking for php executable and cant find it, if you are running php through wsl2/docker then you need to select php executable from there
@@ProgramWithGio I just forgot to download php. Everything is working now. Thanks!
Is there a reference that gives us a list of course in order of the video names?
Yes, the link to the repo is in the description. It contains outline of all videos with title and link
Can you please confirm that the link to your patreon account works? I hit the url but it seems to be broken or something.
Yes works fine on my end, just tested it as well
Hi Gio, one thing about the semicolon, I saw in following videos that when you declare function or classes you don't use the semicolon at the end, why that? Isn't it an end of a statement?Indeed if I put it in those occasions it seems that the script doesn't work, I'm quite confused.
Hey, you don't need semicolon at the end of }. Can you point me to timestamp on the video on what part you are referring to? You don't need semicolon on single line expressions like this
@@ProgramWithGio
I didn't mean u put semicolon at the end of }, I was askin' why is that in general.
"Hey, you don't need semicolon at the end of }" --->why is that? I can't understand where to put semicolons exactly.
I meant that in following videos of yours there were (indeed) no semicolon at the end of } but I cannot understand why if we're saying that we must put them after every statement.
There were something like this(but also seeing other codes):
@@rosarioveneruso9928 } on its own is not a statement so yea you don't put a semicolon there. It's just a closing bracket. If that were case then you would need to put semicolon at the end of each line including the if() {.
P.S. I don't think the above code is from my lesson.
@@ProgramWithGio It isn't , i was just an example(i wrote "somethin' like"), the point was that it wasn't clear to me when/where put semicolon.
"} on its own is not a statement so yea you don't put a semicolon there" I meant the two brackets with what is inside of it, don't we count that as a statement? The block inside of it is not a/a series of instruction/s?
@@rosarioveneruso9928 I would watch lesson about expressions in this series, it might help. You just don't put semicolons at the end of brackets, idk if there is a list of things that you can't put semicolons on but that's one of them. Whatever is contained within control block (within brackets) at the end of those lines you put semicolon, they are usually expressions.
Hello ,pleasehow can i fix the port problem definitly in xampp,cause all the time i open xampp i have to change port number
Maybe something else is running on that port that is holding it up?
How did you make the browser auto update the output of the code?
Power of editing
How to make errors to appear in a browser? I've edited php.ini file and set error_reporting = E_ALL and display_error = On, but nothing changed. The program is still crashes silently.
Did you restart Apache?
❤️❤️❤️❤️❤️
💙💙💙
i am study inglish language in this video
That's awesome
wcan i get like to the creator of this video,im learning php anow, im am lat?
I'm the creator of the video, what's up?
although its hard to read your words. I guess you ask if you are late...
In regards to the comment: 2 years after the video is late but not too late as I guess, especially as the creator himself replied 🙂
In regards to learning PHP: It's never too late to learn new stuff and PHP is still really active as Gio explained.
So I would say no, you are not too late. In the end, I am even later on both points 🙂
I was a bit confused at first until I realized that you do not know the meaning of the symbol quotes in English. ' = apostrophe, " = quotes and "" = double quotes.
Thanks, English isn't my first language, but in PHP we usually call it all quotes (single, double) and saying apostrophe usually confuses people more since most know it as "quotes" and either single or double quote works in most cases.
PHP uses American English only. In whole programming world only single quotes and double quotes is usual.
@@lairotuT-Tutorial So. What is your point?
Srry boys but echo ("Hello {$variable}") is deprecated since php 8 so if you are searching why vscode gives u a warning in this line of code now you know why
Nope, that is not deprecated in PHP 8 and is perfectly valid. Did you define the variable? What error are you getting? Maybe you are referring to PHP 8.2 which deprecates this: "${variable}" but "{$variable}" should still work
@@ProgramWithGio works but vscode says it's deprecated since php 8
@@teacupentertaining6073 I don't see it in the php documentation as being deprecated. You can see here what's deprecated in 8.2: www.php.net/manual/en/migration82.deprecated.php
Good job bro, JESUS IS COMING BACK VERY SOON; WATCH AND PREPARE
Ok, thanks
pls which text editor is suitable to code php
Phpstorm in my opinion is the best
Php8?
Yup, we upgrade to PHP 8, & to 8.1 in following videos. At the time of recording of this video 8.0 wasn't released yet.
ქართველი ხარ ხო ? დ
კი 🙂
@@ProgramWithGio აქცენტზე გეტყობა დდ
პ.ს. მშვენიერი კაი საქმეა, ისე ქართულადაც რო დადო გამოგვადგება ბევრ დამწყებს
@@ნოდარდავითულიანი მადლობა. ქართულად გამიჭირდება რადგან ქართულად არ მაქვს ნასწავლი მე თვითონ 🙂.
hard to follow examples, your screen is too small
Yea, I realized that a bit late. In section 3 it gets better since I zoom in a bit and also I zoom in on parts that are important.
you know what you don't deserve???? a dislike. nice video.
Thank you 🙏
echo print('!!');
:)
Thanks a lot
You are welcome!