Created
January 6, 2012 12:06
-
-
Save aufi/1570288 to your computer and use it in GitHub Desktop.
osekání text na maximální délku utf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function osekej($retezec, $delka) { | |
//vypise jenom zadany pocet znaku (od zacatku) | |
if (strlen($retezec) > $delka) | |
$konec = ".."; | |
else | |
$konec = ""; | |
return mb_substr($retezec, 0, $delka, 'UTF-8') . $konec; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment