x101/E1.php

<!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 $zin = "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Alias, voluptates. Vero, rerum. Quidem ad nesciunt temporibus error, eaque repudiandae, aspernatur officiis dignissimos molestiae delectus, maxime id autem consectetur. Quisquam, numquam!"; $nieuw = verkort($zin); function verkort($woord){ if(strlen($woord)>10){ $woord = substr_replace($woord,"...",8); return $woord; } else { return $woord; }; } echo "$nieuw"; ?> </body> </html>

Resultaat

Made by Thijs Aarnoudse