";
}
// Usage example: display table of number 5
$number = 5;
displayMultiplicationTable($number);
>
&
9
[>
wtBuilt-in Functions for Em
pty String
1 empty( ): The empty( ) function returns true if a string variable is “empty.” EMPtY
string variables are those with the values", 0,0’, or NULL. This function also returns
true when used with a non-existent variable.
Syntax: boolean empty(string)
Program 3.10: Program for empty( ) function.
";
$str = null;
echo (boolean) empty($str) =" "5
$str = '0';
echo (boolean) enpty($str) ." ";
unset($str);
echo (boolean)empty($str) ." ";
2>
Output:
True
True
True
True
Built-in Function for Reversing and Repeating Strings
1. strlen(): This function returns the number of characters ina string.
Syntax: integer strlen(string)
Program 3.11: Program for strlen() function.
Output:
The Length of the string is: 14
3.10c) Write a code in php which accepts two strings
from user and displays them after concatenation.
String Concatenation