For all you new people out there reading comments, PHP is super valuable to learn right now. There are a plethora of jobs needing PHP developers to maintain old systems. Much easier to get a job in php, than to try and get a job in a newer language/framework.
@@kidzeezy0112you should know how to use google. This is the most basic fundamental skill. I am not looking down or mocking you. Train your brain to think of solution first, go to google second. Say to yourself "others will google the answer to tell me. I am not blind. I can search myself too"
@kidzeezy0112 I would recommend using traversy media's front to back series for php then when you're done with that and have a good understanding of what it's all about and build a few projects with php I'd advice you go on and learn the laravel framework👍
I've been a PHP programmer for 22 year. (Yes, since 2001, version 4-something). The language has changed a lot in that time. At the beginning it was very similar to Perl and C, now it's more like Java. Lately however, in my company, some projects are being rebooted in C# and new stuff tends not to be done with PHP at all. I feel like PHP is declining in popularity, which makes me a little sad because I really like the language and I have no interest in C# and all the Microsoft associations that come with it.
Beware: you cannot access variables you declared in your file from inside a function UNLESS you re-declare them in the function with a global prefix. Example: ```php $var = "foo"; function boo(){ echo $var; } ``` Will not echo the string foo because of scope. It will be null basically as the function cannot see the one declared outside. Unless you add a global $var in the function like this: ```php $var = "foo"; function boo(){ global $var; echo $var; } ``` Will echo "foo" as intended. You can also pass by value like bo($var) but that is obvious
The reasoning behind this behavior is rooted in the way PHP handles variable scope. By default, variables within a function are considered local to that function. To access a global variable inside a function, you need to use the global keyword to explicitly indicate that the function should use the variable from the global scope. This design helps prevent unintended side effects and makes the code more modular and easier to understand by clearly delineating where variables are defined and used.
.. i would never use php outside of context of Laravel lol... there's very little reasons to use php tbh... php/laravel is good for todo apps... ever seen anything more built with it? : ))) php servers keels over faster than a node server... backend in node/php is error on itself... just use Go or Elixir for backend or something else...
@@Microphunktv-jb3kj The problem is that you cant use Laravel without knowing php. Or better, you can...but you will write something you dont understand deeply.
Question, folks. I've been writing desktop applications in C# for 10 years. I want to move towards web development. There is scalability and microservices... really eager for it. Employers see that I have no practical knowledge in this area and turn me down. But I can potentially get a position in PHP. Should I go for PHP? Thank you very much, your answer is highly important 🙏
Absolutely, it's still one of the most used languages out there for web development. Mostly because it's so widely supported - it's available on almost all web hosting. Plus it's very simple to pick up and start using, and WordPress (which runs a huge proportion of the web's sites) uses it. So definitely still worth learning and you can get a decent job with it.
Yes, in the last decade and especially the last few years it has improved dramatically. Many features were added to make it easier, nicer, and cleaner to write code, and the performance increased over 4 times. Couple that with composer for managing packages, git, and Laravel framework for making websites, it's a pleasure to code in. There's many big companies using PHP, including Facebook. Also about 80% of all websites on the internet are still using PHP. You can get a decent job, yes, given that a vast majority of sites are using PHP. Even if you decide to switch later, you will learn lots of concepts from PHP and Laravel that are applicable in other languages and frameworks. On average, it's not the most paid job, but that's probably because of all those sites.
Lol 😂 are u fr ? You must change title to 1990s you have completely ignored the entire new system of php that the new frameworks like laravel are count on PHP OOP
Thank you for the feedback! The idea of this video was to cover the syntax basics that are necessary no matter whether you're using a framework or not. I did what I could in 60 seconds (the maximum time for a TH-cam short). I'll cover OO and Laravel in further shorts though.
Since I’ve seen people saying we should use === I’ve always had the reflex to use 3 of them instead of two, I don’t really know what difference it makes though, but if it helps have a more solid code, that’s still worth it anyway
@@cedrictheveneau9141 Anyone who might be wondering: “2” == 2 will be true. (Sorta equals) “2” === 2 will be false. (Exactly equals) The == will perform type coercion if it has to. Which is why “2” (a string) and 2 (an integer) will become true. It’s easier to run into bugs if you don’t fully understand it. That’s why === is almost always the best option.
Bit difficult to say without more details - check your files are named with ".php" at the end, and that they're in a folder you have permission to read from
@@dave-hollingworth yes but it's a self-hosted server with a free domain and local host tunneling...I switched from running plain NGINX to running off Laragon which included php in the environment so that I couldn't install or get php to work in the local host myself or in NGINX even tho it has it.
Well, you can type hint function arguments and properties, which will create an error if you pass a varable that contains a value that doesn't match the type hint. However you can't specify that a variable contains a specific type unfortunately.
"To concatenate a string we use a dot. " No. Don't. Please don't. Use sprintf. Use printf. Hell, use a fucking array and join. Just please don't use dots.
so much information in 60 seconds 👏👏👏
For all you new people out there reading comments, PHP is super valuable to learn right now. There are a plethora of jobs needing PHP developers to maintain old systems. Much easier to get a job in php, than to try and get a job in a newer language/framework.
can you direct me in this direction sir? how do I even start learning this from scratch?
@@kidzeezy0112you should know how to use google. This is the most basic fundamental skill.
I am not looking down or mocking you.
Train your brain to think of solution first, go to google second.
Say to yourself "others will google the answer to tell me. I am not blind. I can search myself too"
@@fuzzy-02 lol we gotta tell 'em haha.
@kidzeezy0112 I would recommend using traversy media's front to back series for php then when you're done with that and have a good understanding of what it's all about and build a few projects with php I'd advice you go on and learn the laravel framework👍
Only if you live in India.
I've been a PHP programmer for 22 year. (Yes, since 2001, version 4-something). The language has changed a lot in that time. At the beginning it was very similar to Perl and C, now it's more like Java. Lately however, in my company, some projects are being rebooted in C# and new stuff tends not to be done with PHP at all. I feel like PHP is declining in popularity, which makes me a little sad because I really like the language and I have no interest in C# and all the Microsoft associations that come with it.
PHP is a multi purpose language. And here we see just one scenario. Good tips.
0:28 You can put a trailing comma after the last item in the list. That can ease program maintenance in some situations.
What’s a trailing comma?
comma at end of value@@likithaapraveen8726
@@likithaapraveen8726comma at the end I guess
@@likithaapraveen8726he means a comma after the "0" value associated to the "third" index in the associative array
@@likithaapraveen8726$var => value,
If you kmow a bit of SQL, its not that's hard to grasp at each glance
Beware: you cannot access variables you declared in your file from inside a function UNLESS you re-declare them in the function with a global prefix.
Example:
```php
$var = "foo";
function boo(){
echo $var;
}
```
Will not echo the string foo because of scope. It will be null basically as the function cannot see the one declared outside.
Unless you add a global $var in the function like this:
```php
$var = "foo";
function boo(){
global $var;
echo $var;
}
```
Will echo "foo" as intended.
You can also pass by value like bo($var) but that is obvious
So "global" word should write in front of it?
The reasoning behind this behavior is rooted in the way PHP handles variable scope. By default, variables within a function are considered local to that function. To access a global variable inside a function, you need to use the global keyword to explicitly indicate that the function should use the variable from the global scope. This design helps prevent unintended side effects and makes the code more modular and easier to understand by clearly delineating where variables are defined and used.
Informative
I wish I could afford to buy your udemy course. you are amazing teacher
Normally it you check it out a few times they give you a huge discount
Udemy courses are cheap and sometimes they give huge discounts.
Actually the video is very useful for those who just know programming language quite well and want to learn php.
.. i would never use php outside of context of Laravel lol...
there's very little reasons to use php tbh...
php/laravel is good for todo apps...
ever seen anything more built with it? : )))
php servers keels over faster than a node server...
backend in node/php is error on itself...
just use Go or Elixir for backend or something else...
@@Microphunktv-jb3kj The problem is that you cant use Laravel without knowing php.
Or better, you can...but you will write something you dont understand deeply.
Question, folks. I've been writing desktop applications in C# for 10 years. I want to move towards web development. There is scalability and microservices... really eager for it. Employers see that I have no practical knowledge in this area and turn me down. But I can potentially get a position in PHP. Should I go for PHP? Thank you very much, your answer is highly important 🙏
I would yes - it's still very popular - explained well here: medium.com/@london.lingo.01/10-reasons-why-php-is-still-relevant-in-2023-d533ed6dc687
@@dave-hollingworth thanks a lot, Dave 🙏. You know, in the middle of 40 to change carriers is very exiting
If you are already proficient in C#, there isn't much use in stepping backwards to php
What is the output
Love it. Php learning is in my future learning plan❤
I’m just happy to be here😂
If our professor explain it simply back then we would get it lol.
Thank you sir
Hypothetically you could teach rocket-science under 2 hours
People have been telling me for years that php is trash. Now I have to learn after seeing this
I was told the same thing 15 years ago. I fell for the hype of other so called hot languages
@@ericg3065 what your final conclusion ?
brilliant
Whole lot of people in here who aren’t devs acting like they’re devs.
Php will be comfortable for people to learn who came from linus os n had learnt bash scripting
$data["first"]
Shoukd be $data['first']
So php doesnt check for a variable
Thnks bro
I am gonna add PHP to my CV after that video
Brillant🎉
Est-ce que je peux avoir tes contact svp
C and html based python
What is the font style you are using in your vscode i like it
Droid Sans Mono (according to the settings - I've never changed it, it was set by the theme I believe)
NICE
Wait, is that a real html tag?
Like I can do it rn and it will work?
Thanks for video! After watching that I’ve finally got a job in IT
Output su Aave che
your college lesson for one month in one minute
My vote is for JavaScript syntax, arrays, objects to be enabled in PHP.
PHP is a Backend language and JavaScript runs in the browser. What do you mean to be enabled?
@@Steve-Richter 😂😂
@@Steve-Richter php is a backend language you can't do like that, you need a class
>Javascript syntax
*vomits*
@@IISveirII Still nicer than PHP.
Wowww in 60s😂
Wich vscode theme are you using?
This one: www.vscolors.com/themes/bf8aa94a-4051-42fe-9bd1-2becad466fe7-41e84e99
Its so ez i thought php is hard its features n syntax like that writing shell script in bash but with few changes
I hate this language but this video is useful
What's a good programming example for starters?
Try this one: th-cam.com/video/Y9yE98etanU/w-d-xo.html
This is: HTML to MySQL with PHP 😎
Name this app
What is the theme u are using??
This one: www.vscolors.com/themes/bf8aa94a-4051-42fe-9bd1-2becad466fe7-41e84e99
@@dave-hollingworth thanks
and everyone complaining that JS is weird
guys do you notice? PHP programming doesn't show error
It does in the browser (dev env)
is php still good? i mean with all the new languages/tech out there, can you still get a decent job using it?
php beginner here.
Absolutely, it's still one of the most used languages out there for web development. Mostly because it's so widely supported - it's available on almost all web hosting. Plus it's very simple to pick up and start using, and WordPress (which runs a huge proportion of the web's sites) uses it. So definitely still worth learning and you can get a decent job with it.
Yes, in the last decade and especially the last few years it has improved dramatically. Many features were added to make it easier, nicer, and cleaner to write code, and the performance increased over 4 times. Couple that with composer for managing packages, git, and Laravel framework for making websites, it's a pleasure to code in. There's many big companies using PHP, including Facebook. Also about 80% of all websites on the internet are still using PHP.
You can get a decent job, yes, given that a vast majority of sites are using PHP. Even if you decide to switch later, you will learn lots of concepts from PHP and Laravel that are applicable in other languages and frameworks. On average, it's not the most paid job, but that's probably because of all those sites.
@@dave-hollingworthsome tech nerds dont know the value of PHP doesnt even know and start speaking shit 😂
There's a reason PHP still powers +75% of the web and all the JS frameworks combined are barely 3%.
What is the software he is using called
VS Code
Sublime text
Foreach is “while” in Python?
stackoverflow.com/questions/44404475/what-is-the-equivalent-of-foreach-php-in-python#:~:text=The%20equivalent%20of%20the%20foreach,e.g.&text=It%20actually%20works%20for%20all%20iterables%20in%20python%2C%20including%20strings.&text=However%2C%20it%20is%20worth%20noting,they%20are%20a%20shallow%20copy.
No, foreach is an iteration while, while is a condition.
just consolidated first 5 tuts in 60s
This is very similar to C, isn't it?
this is php template engine 😂
JOKO WIDODO
Lol 😂 are u fr ? You must change title to 1990s
you have completely ignored the entire new system of php that the new frameworks like laravel are count on
PHP OOP
Thank you for the feedback! The idea of this video was to cover the syntax basics that are necessary no matter whether you're using a framework or not. I did what I could in 60 seconds (the maximum time for a TH-cam short). I'll cover OO and Laravel in further shorts though.
Please dont show the == operator to newbies, hell, dont show it to anyone. Just use ===
Since I’ve seen people saying we should use === I’ve always had the reflex to use 3 of them instead of two, I don’t really know what difference it makes though, but if it helps have a more solid code, that’s still worth it anyway
@@cedrictheveneau9141if u use == (1 == "1" will be true) but if u use (1 === "1" will be false) === will also check the data type to be equal.
@@cedrictheveneau9141
Anyone who might be wondering:
“2” == 2 will be true. (Sorta equals)
“2” === 2 will be false. (Exactly equals)
The == will perform type coercion if it has to. Which is why “2” (a string) and 2 (an integer) will become true. It’s easier to run into bugs if you don’t fully understand it. That’s why === is almost always the best option.
vs code currently does not even read my php :( why
Bit difficult to say without more details - check your files are named with ".php" at the end, and that they're in a folder you have permission to read from
@@dave-hollingworth all is correct on that part..what i'm trying to do is write php within html and it doesn't read it ?
@@brkenheartd Make sure you're using the correct tags, e.g.
@@dave-hollingworth yes but it's a self-hosted server with a free domain and local host tunneling...I switched from running plain NGINX to running off Laragon which included php in the environment so that I couldn't install or get php to work in the local host myself or in NGINX even tho it has it.
@@dave-hollingworth it doesn't matter as long as the php works i'm glad ^_^
Can you help me in 1 script fixing I will pay bro
This is old php4 style
It is only 60 seconds... 🤨
Coloque legendas em português😢
Se tu quer ser programador a primeira coisa que deveria aprender é inglês.
Lost me at $
Wtf is this ? Why are there so many dollar signs?
U gotta chill bruh talking too fast cuh
"PHP in 60 seconds" bro , he's supposed to speak fast otherwise he won't finish in time!
@MohammadSafa-ms5nw Nah make it php in 120 sec then
@@trb147 then it won't be a TH-cam short.
I am not interested in PHP
First sentence ist wrong
Its truthy, but yes, php only require the opening tag in a pure php file.
Also you can put types for variables so another mistake
Well, you can type hint function arguments and properties, which will create an error if you pass a varable that contains a value that doesn't match the type hint. However you can't specify that a variable contains a specific type unfortunately.
@@dave-hollingworth /* @var int $a */
$a = 1
Is enough for phpstorm
"To concatenate a string we use a dot. " No. Don't. Please don't. Use sprintf. Use printf. Hell, use a fucking array and join. Just please don't use dots.