PHP has built-in (ready-made) functions that are very useful for certain tasks. You do not have to reinvent the wheel because PHP already did it! There are lots and lots of built-in functions, but what we will teach you are the most commonly used.
Don't worry! You don't have to memorize all of these. It is more important for you to be able to reference any function and use it than to have a group of them memorized. You will learn more about functions as you continue to develop in PHP. Note that each function has a specified number of parameters, sometimes none at all, and will return a value.
Functions for Strings
strlen - get string length
strtolower - make a string lowercase
strtoupper - make a string uppercase
ucwords - uppercase the first character of each word in a string
str_replace - replace all occurrences of the search string with the replacement string
Built-in Functions
PHP has built-in (ready-made) functions that are very useful for certain tasks. You do not have to reinvent the wheel because PHP already did it! There are lots and lots of built-in functions, but what we will teach you are the most commonly used.
Don't worry! You don't have to memorize all of these. It is more important for you to be able to reference any function and use it than to have a group of them memorized. You will learn more about functions as you continue to develop in PHP. Note that each function has a specified number of parameters, sometimes none at all, and will return a value.
Functions for Strings