Hey guys.
Unfortunately I can't break out of an echo to run the if statement I want to run because it's pulling data for a certain row.
I'd like text truncated to a certain amount of characters or a certain width but if the textual content is less than that amount of characters I want it untouched.
My code so far is...
And it generates this output (the right hand table of newest items in the album bit):
<Link removed>
I'm a bit of a novice, can anyone offer any suggestions?
Much appreciated
Unfortunately I can't break out of an echo to run the if statement I want to run because it's pulling data for a certain row.
I'd like text truncated to a certain amount of characters or a certain width but if the textual content is less than that amount of characters I want it untouched.
My code so far is...
Code:
echo "</td><td class='listingtitle'>Artist:</td><td><a href='http://megalyrics.net/search.html?c=".$row[artist]."' title='View ".$row[artist]." Lyrics'>".$row[artist]."</a></td></tr><td class='listingtitle'>Album:</td><td><a href='http://megalyrics.net/search.html?c=".$row[album]."' title='View ".$row[album]." Lyrics'>".preg_replace('/\s+?(\S+)?$/', '', substr($row[album], 0, 30))."...</a></td></tr>";
<Link removed>
I'm a bit of a novice, can anyone offer any suggestions?
Much appreciated
Comment