22: How to Create Your Own Function in PHP | PHP Tutorial | Learn PHP Programming | PHP Lesson

preview_player
Показать описание
How to Create Your Own Function in PHP | PHP Tutorial | Learn PHP Programming | PHP Lesson. A function is used in PHP to run a script that has a specific purpose in your code. Today we will learn about functions and how to use them in our websites.

➤ 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 :)

Рекомендации по теме
Комментарии
Автор

these are so good. All the other videos I've seen feel like they're not teaching you at all they just show you that *they* can do it...

kiiturii
Автор

I think your tutorials are the best. Finally, I know how to use PHP practically. I like the way you keep things simple, no complicating matters. Indeed, simplicity is the ultimate sophistication.

waitajoseph
Автор

I have watch many php program But you are the only one why simplify for the lane you very much

zedpiecce
Автор

*Expand this comment if you're a beginner who is confused.

*Note for non-beginner programmers: from within the local scope of a function, a global variable can only be accessed if you first write the keyword 'global' before the variable name. There's also a PHP defined array named $GLOBALS that uses the name of the globally defined variable as the accessor(e.g., $GLOBALS['varName'])

I love all of your videos so far. I think that this video is treading dangerous territory. I'm sure you go over this later on(confirmed that he does), but I believe this video should have directly addressed what variable scope is. The explanation of functions was uncharacteristically unorganized from what I've seen of your tutorials. I believe you should have explained functions that don't take arguments. Then explained functions that do take arguments. Then explained that functions can return values as well.

I know when teaching about programming, sometimes it's best to just say "we'll explain why later". In this case, I think the order in which things are discussed could easily be confusing.

Specifically the section about scope that talks about local and global scope and how to access a global variable from within a function.

Specifically the sections: Creating PHP Function, PHP Functions with Parameters, Passing Arguments by Reference, and PHP Functions returning value.

It may seem like it's a lot of material, but It's all straightforward and are consistent properties of most programming languages, which is why even though I'm learning php like you, I understand those concepts. I don't think it will take much time at all to absorb what you need to know.

hehhehdummy
Автор

Good tutorials man :) I just have to clarify that the function is not looking for $x. You can call a variable inside the parameters any way you want(like $y). What matters is what you pass trough to that function when you are calling it in newCalc(&x). We are passing value 100 that is contained inside $x and function takes it and saves it into $y.

AdrieShahla
Автор

I have a question in minute 6:37, is that a meowing language?

samy_akrouh
Автор

I just wanna thank you for these awesome tutorials and also thank you for replying my question. I couln't be enjoying this more than I am right now :)

vojka
Автор

Thanks sir for such a great teaching. I hope I can study php completely through this chanel.

purnarai
Автор

thank you dan👋 am enjoying your tutorials

aderickzaki
Автор

Thank you for these videos, they are absolutely wonderful to compliment my college coursework!!

huckleberrymack
Автор

So to sum up:

Parameters in the functions is like bridges between external code (outside of the function) and inside code (between { }).
Everything I wont to pass from function our in function need to go through parameters?

FskpZ
Автор

just a doubt: why not use the break inside the function itself. i mean the line where you've written
echo "This is 75% of what you've written".$newnr. "<br>". That way you can actually avoid writting echo "<br>" all the time

pratikthorat
Автор

Thanks for the video, for a beginner like me it is really easy to understand.

riaznapa
Автор

Hi Dani, great content. One question, how do I create an open variable, where the user is the one that inputs the value so that the answer will vary accordingly??

voiceluckan
Автор

i'm very sorry, i thought i subscribed to you channel long time. you are really a pro and a teacher. i love your explanations very much. even if you sell your tutorials to me for i will buy

galynag-eivv
Автор

When you finish the beginer tutorials try sell the next tutorials advanced, i will definitely buy, your tutorials are the best.

eosapril
Автор

Which "theme" and "Color Scheme" did you use in your Sublime text? Please tell me. I like the UI.

saifurpro
Автор

Hi Daniel, Thank You for videos. Could You tell me your Sublime Theme name ? or Was it only
an old version?

jasurjonmamatkulov
Автор

I dont have the funds to donate on patreon, but I really appreciate the free learning you offer- you're a fantastic teacher so i white-listed your YouTube account on adblock just to give you that little ad revenue. Thanks Daniel.

greenmansession
Автор

Hello! what theme and color scheme does you use?

mixalisiakovou
welcome to shbcf.ru