/ Published in: PHP
Dear php coders,
Here's a code block that you can use in your projects to get shorter long urls.
Also recommend these articles about [ozon tedavisi](http://www.denizliozon.com) here.
Have a nice coding.
Here's a code block that you can use in your projects to get shorter long urls.
Also recommend these articles about [ozon tedavisi](http://www.denizliozon.com) here.
Have a nice coding.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function shorturl($url){ if($length > 45){ $length = $length - 30; $new = $first."[ ... ]".$last; return $new; }else{ return $url; } } ?> // USAGE <?php $longurl= "http://www.google.com/search?q=symfony+project&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:tr:official&client=firefox-a"; $shorturl = shorturl($longurl); echo "<a href=\"$longurl\">$shorturl</a>"; ?>