-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubstring.php
33 lines (31 loc) · 935 Bytes
/
substring.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<?php
// $count = strlen($description);
// if ($count >=322) {
// $trancate = substr($description,0,200);
// }else{
// echo "false";
// }
function trancate($description){
$count = strlen($description);
if ($count>=322) {
$description = substr($description,0,200);
}else {
echo "False";
}
return $description;
}
$description = "Linux was originally developed for personal computers based on the Intel
x86 architecture, but has since been ported to more platforms than any other operating system.
[18] Because of the dominance of Android on smartphones
, Linux has the largest installed base of all general-purpose operating systems.";
echo trancate($description);
?>
</body>
</html>