Created
January 12, 2016 14:05
-
-
Save AdamMadrzejewski/1a665e6c1a53e402f1ee to your computer and use it in GitHub Desktop.
Short text by whole words + '...'. Super simple.
This file contains 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
<?php | |
if (strlen($property->pro_name) > 75) | |
{ | |
$propertyName = implode(" ", explode( "\n", wordwrap($property->pro_name, 75))).'...'; | |
} | |
else | |
{ | |
$propertyName = $property->pro_name; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment