Output functions are used to display text on web page. The different types of output functions are given below.
- print: This function is used to display the output on the browser and return value as true if output is printed successfully or it returns false.
<?php
$rv=print “Webnoid”;
print $rv;
?> - Echo: This function is same as print function but it doesn’t return any value. So it perform faster than print function. We can also print multiple statements with single echo function.
<?php
echo “Webnoid”, “Schools”;
?> - var_dump: This function is used to display value of variables along with data type.
<?php
$sno=100;
$uname= “Webnoid”;
var_dump($sno);
var_dump($uname);
?> - printf: This function is used to display the value along with format specifier.
<?php
$sno=100;
$uname=”Webnoid”;
printf(“%d”, $sno);
printf(“%s”, $uname);
?> - print_r: This function is used to display all elements of array variable and properties of object
- isset: This function is used to check whether the variable is set with any value or not
<?php
$no =100;
echo isset($no);
?> - unset: This function is used to delete the value of the variable.
<?php
$no=100;
unset($no);
echo isset($no);
?>