PHP Programming Basics Practice Test: PHP Arrays and Functions — Flashcards | PHP & Programming | FatSkills

PHP Programming Basics Practice Test: PHP Arrays and Functions — Flashcards

Fast review mode: answers are shown by default so you can skim quickly. Hide them if you want to self-test.

Quiz on arrays in PHP and other in built functions of PHP.

In PHP, an array is a fundamental data structure that stores and organizes multiple values under a single variable. It provides a convenient way to manage and manipulate collections of data, making it an essential concept in PHP development. 

PHP has over 1,000 built-in functions that can be called directly from within a script. These functions are pre-defined and included within the core PHP language. They can be used without any special requirements or additional installation. 

Some examples of built-in functions include:
String functions: Manipulate strings. Examples include:

strlen(): Calculates string length
strtoupper(): Converts strings to uppercase
substr(): Extracts a portion of a string

Mathematical functions: Perform mathematical operations
Date and Time Manipulation:
Functions for working with dates and times, such as date() to format and display current date and time
Array Manipulation: Functions that offer various ways to manipulate arrays, such as count() to get the length of an array 

In addition to built-in functions, PHP also allows users to create their own custom functions. To create a user-defined function, you can:
Start with the keyword function
Follow with the name of the function
Give the function a name that reflects what the function does 

To call a function, you can: Write its name followed by parentheses ()
For example, `function myMessage() ( echo `Hello world! ''; ) myMessage(); 

All functions in PHP return a value, even if you don't explicitly cause them to. You can specify the return value of your function by using the return keyword. 

1 of 62 Ready
How to define a function in PHP?
function functionName(parameters) {function body}
Shortcuts
Prev Space Show / hide Next
Turn this into a study set.
Sign in with Google to save tricky questions to your reminder list and resume on any device.
Sign in with Google Free • no extra password