This course is designed to give you the foundation for becoming a productive PHP developer in a LAMP environment. You'll learn the syntax of PHP and the simplicities of form processing, including functions, arrays, classes, operators, database integration, and more.
Introduction PHP is a real programming language. I think that from the beginning, when its acronym stood for Personal Home Page, some might've thought less of the language's capabilities. In this course, I hope to dispel any such thoughts by covering many of the ins and outs of this robust and flexible programming language.
General Types This is module 2, and in this module we're going to cover the General Types. What does that exactly mean? It means we're going to be covering some of the basics of the PHP programming language. And when I mean basics, I mean basics. We're first going to cover the comments and case sensitivity. Then we're going to go over some of the variables. These variables that we'll cover in this module include integers, Boolean, decimals, and constants. Using built-in functions, we'll then be able to determine those different variable types. As a side note, in this module we will be using functions, though we have not covered them yet. The functions that are utilized in this module are pretty basic. They shouldn't cause you too much of a headache as you go through the demos.
Functions This module is going to be all about Functions. In other programming language, functions is referred to as methods, but since we're working with PHP, we're just going to stick to the word functions. In this module, we're going to cover creating and calling a function, parameter passing, including default parameters, and definitely we'll touch on returning values from our functions, and variable functions, which is a really cool feature of PHP. And last but not least, we're going to cover variable scope inside of our function and within our PHP script.
Strings Strings are an integral part of the PHP programming language. It is almost inevitable that in any of your PHP scripts you will utilize strings. With that being said, in this module we're going to cover the basic string creation. We'll go over what we've previously learned in the other modules and add on to that. Up until now we've been using the echo keyword to print out any of our variables. In this module, we will demonstrate the print function and when it's applicable to use it. Then we'll move on to string functions. PHP has a ton of built-in string functions. And when I say a ton, I mean close to a hundred different string functions that we could use. To add a sense of drama, here is a list of all of the string functions that PHP has to offer. And if you're counting, that's a total of 98 string functions. Now those functions that have been highlighted in this list will be taught in this module. Now that you've seen all the functions, let's get started on basic string creation.
Arrays Arrays are an invaluable type in the PHP programming language. They become very useful when working with database records, which will covered in a later module. In this module we will cover a lot of the basics of the array type, including what is an array and the creation of an array. We will learn how to access the values inside of an array. And just like with the string type, the array type has a bunch of built-in functions. A handful of these will be covered throughout the module. There aren't quite as many built-in functions as there were with the string type, but there is enough to have another scrolling view of all of the array functions PHP has to offer. Again, the highlighted function calls will be covered in this module. And for those who like facts, that is a total of 79 functions that deal solely with the array type.
Classes & Objects Object-oriented programming was added to PHP in version 4. In version 5, the object model was rewritten with more features, better performance, and now boasts a full object model. We will be focusing on object-oriented programming and the use of classes and objects. Just a quick overview of what we're going to learn in this module. We're going to learn what a class is, we're going to learn how to create a class and use a class, we're also going to learn how to access parts of the class, and we're going to learn about inheritance and visibility amongst the properties and methods inside of a class. And the very last thing we'll cover in this module is how to include PHP files inside of our script. Instead of going over a bunch of slides of what object-oriented programming is and what a class is, we're just going to jump right in and start programming classes with PHP. In the next clip, we're going to cover the basic structure of a class.
Operators & Control Structures Now that we have covered functions, classes, and types, we can start getting into the fun type of coding with operators and control structures. An operator takes a value or multiple values and returns a new value. Think about adding two numbers together. The addition is an example of an arithmetic operator, this expression then yields anther number. We will be covering many different types of operators in this module. We will also be covering control structures. Control structures with the use of our operators allows us to control which blocks of code will be executed. Let's jump right into coding with arithmetic operators.
Databases Since version two, php has had the ability to connect to a database. Over time the functions and classes to access those databases has changed and evolved, some have even been deprecated. But the ability to connect to a database in any language opens the doors for endless opportunities. In this module, we are going to cover the databases that are accessible by php, we are then going to learn the difference between the two main methods to connect to a database, then we are going to jump right into setting up our current environment so we can access a database whether you're on Lenox or Windows. Once that is complete, we're going to use php to access out database and run queries against it. In the next clip we are going to learn about the databases that php can connect to.
Web Programming Well, we have finally made it. We are finally discussing the main purpose why PHP was created, to create dynamic websites. In this module, we are going to cover the layout and structure of the website we will be working with. Then we will cover the two basic ways of accessing form data. Next will be form validation, and lastly, we will cover sessions. In the next clip we will make sure that we can view the website we will be working within a Linux environment.