Join Kevin Skoglund for an in-depth discussion in this video Understanding array pointers, part of PHP Essential Training.
- [Instructor] Before we leave the topic of loops behind,…I want to talk about array pointers,…and show you how they work.…It may seem like a technical detail,…but it will become important later…when we start working with databases.…PHP maintains a pointer that points…to one of the items in an array.…That item is referred to as the current item.…By default, that's always the first item in the array.…When we start looping through arrays,…using something like forEach PHP moves the pointer…down the array as it assigns each value…to the loop's variable.…Moving the pointer to the next item…is how PHP keeps track of which item you're working with now…and what the next item is that it should…give you after that.…
But loops are not the only way to move pointers around.…Let's take a look.…Let's create ourselves a little workspace…by using basic .html.…I'm going to use Save As,…and we're going to create pointers.php.…To begin with, let's just give ourselves…a little area here.…PHP and we'll put in array of ages.…I'll also change the title to be pointers.…
- 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.