What is a function in PHP?

  • A function in PHP is a block of reusable code that performs a specific task.
  • A function in PHP is a variable used to store data.
  • A function in PHP is a statement used to control the flow of execution.
  • A function in PHP is a loop used to iterate over an array.
The correct option is: "A function in PHP is a block of reusable code that performs a specific task." Functions in PHP are used to encapsulate a set of instructions that can be called and executed multiple times throughout a program. They help in organizing code, promoting reusability, and improving code readability. Learn more: https://www.php.net/manual/en/language.functions.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *