# Functions Will make your code easy to read and reuse.
# Large projects would be unmanageable without functions because the problem of repetitive code would bog down the development process
# A function accepts values, processes them, and then performs an action (printing to the browser, for example), returns a new value, or both.


PHP has 2 types of functions

1. Language defined functions
2. User defined functions

Language defined functions

PHP has hundreds of built-in functions . For example strlen() returns the length of a string, in characters .

User defined functions

You can define your own functions in PHP using the function statement. A function name can start with a letter or underscore but not a number. Variables names are case sensitive in PHP, function names are not.



Related Articles

  • English Tutorials2016-07-12PHP Functions# Functions Will make your code easy to read and reuse. # Large projects wo… Read More
  • PHP2017-07-26PHP සිංහලෙන් - I වැඩසටහන්කරණ භාෂා අතර ප්‍රමුඛව භාවිතා වන භාෂාවක් වන PHP ගැන සරලව මුල සිට තේරෙන ස… Read More
  • English Tutorials2016-07-12PHP LoopsWhen you need the same block of code to be executed over and over again . In P… Read More
  • PHP2017-07-26PHP සිංහලෙන් - XIII PHP Function function එකක් යනු කිසියම් කේත කොටසකින් ලබාගන්නා ආදානයකට අනුකූල වට… Read More
  • English Tutorials2016-07-12PHP Scope of Variables•The scope of a variable is the range of statements in which the variable can be… Read More
  • English Tutorials2016-07-12PHP Conditional Statements Conditional Statements Need to take different actions for different decisions… Read More