PHP Built-in Functions
PHP contains built-in functions for completing common (and some niche) tasks. This course will teach you how to find and use functions.
StartKey Concepts
Review core concepts you need to learn to master this subject
PHP built-in functions
PHP built-in functions
echo "I am built in";
PHP comes standard with many built-in functions. They give us an easier way to implement and repeat popular tasks throughout a program. A popular example is the echo
function.
Many more are documented at https://www.php.net/docs.php. In addition to a description of what the function does, the documentation for each function denotes:
- The name of the function
- Required parameters and their types
- Optional parameters (in square brackets, []), their types, and default values
- The return type of the function (after the final colon, :)
Intro to Built-in PHP Functions
Lesson 1 of 1
- 1If you’ve been paying attention so far, you might have picked up a theme in programming—shortcuts. Defining our own functions gives us an easier way to repeat similar code throughout a program. B…
- 2PHP includes useful built-in functions for getting information about variables. The gettype() function takes a variable as its argument and ret…
- 3We can find PHP built-in functions to accomplish common tasks. Need to reverse a string? There’s a built-in function for that! The [strrev() function](https://www.php.net/manual/en/function.strre…
- 4A substring is a portion of a string. For example, “hello” is a substring of the string “Oh hello, how are you?” and “el” is a substring of the string “hello”. Manipulating strings is very common…
- 5Another common task in programming is working with numbers, so it shouldn’t surprise us that PHP comes with some handy built-in functions for working with numbers. The [abs() function](https://ww…
- 6Generating random numbers may not seem obviously useful, but, as your programs become increasingly complicated, you’ll see this is actually a common task—for example to randomize data for testing. …
- 7In order to understand built-in functions we’ve never used before, we’ll want to get comfortable understanding how they are represented in the documentation. Documentation typically includes: + The…
- 8In order to find out about built-in functions (and other language features), you’ll want to get comfortable exploring the PHP documentation. The docs ca…
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory