Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

create short url slugs

<html>
<head>
<title>Online PHP Script Execution</title>
</head>
<body>
<?php
     $n = "wwww watt zzzzzzzzzzzzzz";
$n = preg_replace('/(.)\1+/', '$1$1', $n);

echo $n;

function truncate($str, $chars, $end = '') {
    if (strlen($str) <= $chars) return $str;
    $new = substr($str, 0, $chars + 1);
    return substr($new, 0, strrpos($new, ' ')) . $end;
}

$r = truncate('My rrr', 5);

echo "<hr /> $r";

?>
</body>
</html>

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.