Trium918 Posted August 16, 2007 Share Posted August 16, 2007 The script below works for the shorten part, but what would I have to do in order to show the entire string when the mouse roll over it? Can this be done using PHP? <?php // Article Title $title = $row_articles['title']; $titlelenght = strlen($title); $charlimit = "35"; if ($titlelenght >= $charlimit) { $outputTitle = substr($title,0,$charlimit) . "..."; print $outputTitle; //echo $titlelenght; }else{ print $title; } ?> Link to comment https://forums.phpfreaks.com/topic/65179-solved-shorten-variables-longer-than-x-characters/ Share on other sites More sharing options...
PyraX Posted August 16, 2007 Share Posted August 16, 2007 The only tip i can give you is that it will be javascript and the full $row_articles['title'] will be part of the code Link to comment https://forums.phpfreaks.com/topic/65179-solved-shorten-variables-longer-than-x-characters/#findComment-325454 Share on other sites More sharing options...
Trium918 Posted August 16, 2007 Author Share Posted August 16, 2007 The only tip i can give you is that it will be javascript and the full $row_articles['title'] will be part of the code I tried to google it but I found no results. Anything else that is useful would be great. Thanks. Link to comment https://forums.phpfreaks.com/topic/65179-solved-shorten-variables-longer-than-x-characters/#findComment-325463 Share on other sites More sharing options...
btherl Posted August 16, 2007 Share Posted August 16, 2007 Overlib can do that Link to comment https://forums.phpfreaks.com/topic/65179-solved-shorten-variables-longer-than-x-characters/#findComment-325466 Share on other sites More sharing options...
Trium918 Posted August 16, 2007 Author Share Posted August 16, 2007 Overlib can do that Ok, I have the Overlib. PHP is embedding into the Javascript the same way that it is embedding into HTML, correc? Link to comment https://forums.phpfreaks.com/topic/65179-solved-shorten-variables-longer-than-x-characters/#findComment-325475 Share on other sites More sharing options...
Trium918 Posted August 16, 2007 Author Share Posted August 16, 2007 I got it! I just used the title attribute inside of the <a></a> tag. Thanks! Link to comment https://forums.phpfreaks.com/topic/65179-solved-shorten-variables-longer-than-x-characters/#findComment-325476 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.