PHP Functions | Functions in PHP - PHP Tutorial 59

PHP Functions | Functions in PHP - PHP Tutorial 59

ChidresTechTutorials

4 года назад

8,139 Просмотров

Notes for You:: PHP Functions.
- A function is a block of code with name, meant to perform a specific task.
- Whenever we want to perform a specific task, we create a function.

Creating a function:
- A function is created or defined with the help of function keyword.

Syntax: /* function definition */
function functionName( [param1,param2, …. paramN] )
{
statement(s) to be executed;

[return returningValue;]
}

Example:
- A function without parameters, without returning value.
function wishHi()
{
echo "Hi", "<br/>";
}

Note: Functions get execute only when we call them.

Syntax: /* function call */
functionName( [ param1, param2 …. paramN ] );

Example:
wishHi(); // Hi

Note: Why Functions? Functions are created
- for manageability (i.e. to divide a larger problem into smaller tasks or modules)
- for reusability (i.e. once a function is defined, it can be used multiple times)
- for abstraction (i.e. hiding the way how tasks are done) (creating libraries)

Example:
wishHi(); // Hi
wishHi(); // Hi
wishHi(); // Hi

Note: By default a function returns null in PHP.
var_dump(wish()); // null


Note:
- replace < with less-than symbol.
- replace > with greater-than symbol.

=========================================

Follow the link for next video:
PHP Tutorial 60 - Types of Functions in PHP | PHP Types of Functions
https://youtu.be/rYeVG1RYw5s

Follow the link for previous video:
PHP Tutorial 58 - Program to print Pyramid pattern of Stars and Numbers in PHP
https://youtu.be/ghHxzP344-g

=========================================

PHP Tutorials Playlist:-
https://www.youtube.com/playlist?list=PLdE8ESr9Th_s8zash4d8He_49QS_VVmAG

=========================================
Watch My Other Useful Tutorials:-

MySQL Tutorials Playlist:-
https://www.youtube.com/playlist?list=PLdE8ESr9Th_tvPGAlbOEc-0_qleTOBgmU

HTML Tutorials Playlist:-
https://www.youtube.com/playlist?list=PLdE8ESr9Th_uUR1vA9h-AP4uyzZXb0lqA

CSS Tutorials Playlist:-
https://www.youtube.com/playlist?list=PLdE8ESr9Th_vdJ6wbXrZh6Ppra7IOf8fF

JavaScript Tutorials Playlist:-
https://www.youtube.com/playlist?list=PLdE8ESr9Th_seeZTebEFavp257vds9ph5

=========================================

► Subscribe to our YouTube channel:
https://www.youtube.com/chidrestechtutorials

► Visit our Website:
https://www.chidrestechtutorials.com

=========================================
Hash Tags:-
#ChidresTechTutorials #PHP #PHPTutorial

Тэги:

#php_functions_tutorial #php_functions #functions_in_php #learn_php_functions #php_functions_explained #php_functions_advanced #creating_functions_in_php #calling_functions_in_php #using_functions_in_php #php_7_functions #control_statements_in_php #control_structures_in_php #php_tutorial #php_tutorials #best_php_tutorial_youtube #web_design_tutorial #web_technology_tutorial #chidres_tech_tutorials_php #chidres_tech_tutorials #manjunath_chidre
Ссылки и html тэги не поддерживаются


Комментарии:

@kadriahamadamouroivili187
@kadriahamadamouroivili187 - 01.09.2023 18:58

Understood!

Ответить
@temiladeadeniran7811
@temiladeadeniran7811 - 14.06.2023 17:22

Nice 👍

Ответить
@zubayergillarkyckling7832
@zubayergillarkyckling7832 - 26.09.2022 11:45

very handsome thumbnail bhai

Ответить
@stefanpfadt4353
@stefanpfadt4353 - 23.06.2022 23:10

Cool! happy to see your channel :)
Can I ask how you know a functionName/keyword? where do I look for the keyword?

Ответить