PHP Built-in Function with Example

aimtocode

Built-in functions

PHP is very rich in terms of Built-in functions. there are more than 1000 built-in functions in PHP. To use those functions we just need to call them as per our requirement like, var_dump, fopen(), print_r(), gettype() and so on.

Click below to Read in Details


PHP Functions with Parameters

The parameters work like placeholder variables within a function; they're replaced at run time by the values (known as argument) provided to the function at the time of execution





Result:


Sum of the two numbers 18 and 2 is : 20


Passing Arguments by Reference

This means that a reference to the variable is manipulated by the function rather than a copy of the variable's value




Result:


Original Value is 13
Original Value is 18


PHP Functions returning value

The return keyword is used to return value back to the part of program, from where it was called.a



Result:


  The product is: 10
  
aimtocode