Join Kevin Skoglund for an in-depth discussion in this video Define functions, part of PHP Essential Training.
- [Instructor] A function is code that performs…a specific task,…which has been packaged up into a single unit,…that can then be called upon whenever that task is needed.…An example of a function we've already seen and used…would be, inArray, anytime that we want php to check…whether an element is in an array,…we can call the inArray function.…We provide the function data to work with…in the form of arguments,…and the function returns output to us at the end.…This a common feature of functions,…providing them input, and getting back output.…Up until now, we've been looking…at the built-in functions that php provides,…but we aren't limited to just these functions,…we can also define our own.…
In this chapter, we'll learn how to craft and use…custom functions, and we'll start…by learning the syntax that's used to define them.…You define a function by first saying function,…and then a space, and then the name…that you want to give this function,…it's very much like the variable names that we assign,…and the rules are very similar.…
- What is PHP?
- Embedding PHP code on a page
- Inserting code comments
- Variables, strings, arrays, and Booleans
- If, else, and elseif statements
- While and for loops
- User-defined functions
- Function arguments and return values
- Debugging and troubleshooting
Skill Level Beginner
MVC Frameworks for Building PHP Web Applicationswith Drew Falkman2h 57m Intermediate
1. PHP Overview
2. First Steps
3. Explore Data Types
4. Control Structures: Logical Expressions
5. Control Structures: Loops
6. User-Defined Functions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.