DWPD-3.4: Write PHP script to demonstrate string function.

string fucntion in php
Lab # 3

FUNCTIONS

4. Write PHP script to demonstrate string function.

Lab-3-4-string-functions.php

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
$str1="PHP";
$str2="Programming";

echo "Origina : $str1 and $str2<br>";

$l1=strlen($str1);
$l2=strlen($str2);
echo "Length : $l1 and $l2<br>";

$add=$str1+$str2;
echo "Addition : $add <br>";

$ord=ord($add);
echo "Ord of $add : $ord <br>";

$chr=chr($ord);
echo "chr of $ord : $chr <br>";

echo "strlen of $chr : ".strlen($chr)."<br>";

?>

Output

string function in php
String Functions


Happy Coding 🙂

Leave a comment