Skip to content

Instantly share code, notes, and snippets.

@applehat
Last active December 15, 2015 13:09
Show Gist options
  • Save applehat/5265440 to your computer and use it in GitHub Desktop.
Save applehat/5265440 to your computer and use it in GitHub Desktop.
<?php
$original = $some_variable;
$length = 100;
echo (strlen($original) > $length)?substr($original,0,$length)."...":$original;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment