<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
echo shorten("Hallo, mijn naam is Max");
function shorten($str){
if(strlen($str) < 10){
return $str;
}
else{
return substr($str, 0, 8) . "...";
}
}
?>
</body>
</html>
Made by Thijs Aarnoudse