User Defined Functions: Prointegra IT Solutions (P) LTD
User Defined Functions: Prointegra IT Solutions (P) LTD
PANKAJ
Prointegra IT Solutions (P) Ltd. Nagpur.
UDF(user defined functions) are the
function which r created by user as per
his own requirements.
Example : abc(), mysum().
<?PHP
function sayhi()
{
echo "Hi & Hello World ";
}
function ln()
{
echo "<br>=-==-=-==-=-==-=-==-=-==-=-==-=-= <br>";
}
ln();
echo "Welcome ";
sayhi();
ln();
?> Output
Functions with parameters.
<?PHP
function tot($A,$B)
{
$t=$A*$B;
return ($t);
}
Output : Tot is = 13
Predefined Function
empty() Function
<?php
$var;
// Evaluates to true because $var is empty
if (empty($var))
{
echo'$var is either 0,empty,or not set at all';
}
else
echo "There is Something...";
?>
is_numeric()
<?php
$x=hj;
if (is_numeric($x))
{
echo "is integer\n";
}
else
{
echo "is not an integer\n";
}
?>
Strlen()
<?php
echo strlen("Hello world!");
?>
O/p : 12