Create a function in PHP
lessonDuration 1m 52s
In this lesson, we will go over how to create a function with proper syntax in PHP with the function keyword.
Browse
Find courses, lessons, articles, talks, and podcasts.
93 resources
Showing 25–48 · Page 2 of 4
lessonDuration 1m 52s
In this lesson, we will go over how to create a function with proper syntax in PHP with the function keyword.
lessonDuration 1m 34s
Sometimes you need to group together pieces of code. That's what functions are for! In this lesson, we'll learn all about them.
lessonDuration 2m 34s
Storing an array within an array is possible with PHP, and are called "multi-dimensional" arrays.
lessonDuration 1m 26s
One can expand on PHP's foreach loop by using array indexes, which allow you to control the location of PHP elements.
lessonDuration 1m 56s
Iterating, or looping over an array is very easy with PHP's foreach loop.
lessonDuration 1m 11s
Lists are found in every programming language, and PHP is no exception. Let's learn how to create a list using an array.
lessonDuration 3m 7s
A switch statement includes a few awkward caveats that don't exist in PHP 8's new match statement. In this lesson, we will learn how to use a match statement to execute when a condition matches a specific value.
lessonDuration 4m 12s
When you find yourself repeating or writing similar conditional logic in your if statements, a better option may be a switch statement.
lessonDuration 3m 33s
An if statement that depends upon the logic of a boolean can be simplified into something called a "ternary", which can lead to more concise & readable code.
lessonDuration 3m 36s
Writing if statements alongside your HTML can be confusing to process. Because of this, PHP supplies an alternate if/else syntax for outputting PHP alongside HTML.
lessonDuration 1m 48s
Every programming language has the concept of conditional statements. In this lesson, we will go over how to create if statements in PHP.
lessonDuration 3m 28s
Booleans toggle variables to true or false, depending on the outcome of the expression. You can also negate values, which reverses the polarity of the PHP variable.
lessonDuration 4m 40s
Variables are great, but sometimes you need to be able to set a value in PHP, and ensure it never changes. Constants to the rescue!
lessonDuration 1m 38s
Concatenating strings together can sometimes be hard to read. As an alternative, you can use string interpolation to output variables within strings in PHP.
lessonDuration 3m 8s
Joining two strings together is something you will do a lot in PHP. Learn a few different ways to concatenate strings together.
lessonDuration 2m 48s
Sometimes internet programming languages such as JavaScript & PHP do something funky when working with variables. Learn about this "type juggling", and how it works.
lessonDuration 2m 5s
Sometimes PHP's automatic data type assignment just doesn't work for your needs. In this case, you can cast a type to a specific variable.
lessonDuration 1m 53s
PHP's echo statement is so common, it comes with an alternate "short echo tag" syntax. Let's learn how to use this syntax to clean up our view code.
lessonDuration 1m 8s
There is a difference between PHP functions and language constructs. Let's go over how to call them, and usage with & without parenthesis.
lessonDuration 2m 58s
Closing tags and semicolons play an important part in the execution of PHP code at the time of execution. We'll learn all about them as well as line breaks in this lesson.
lessonDuration 2m 1s
What's a tutorial without a hello world lesson? Let's learn about open and closing PHP brackets, and the "echo" language construct, which is perhaps the most-used construct in the language.
lessonDuration 2m 36s
Usually when you are building a website, you’ll have a web server such as Nginx or Apache that sits in front of the PHP service. But in this lesson, we’ll use a much simpler method: use the built-in PHP web server!
lessonDuration 1m 58s
There are many different options when it comes to choosing a PHP editor, from Notepad to VSCode to PHPStorm. Let's pick an IDE and create our project folder.
course
Learn the basics of Docker.