|
Posted by Jim Carlock on 03/11/06 19:32
If I'm putting together a list of links and I want to get add each
item one at a time inside a foreach($aNames as $sName) loop,
is there an easy way to get the number of pixels that the $aName
takes up?
For instance, in creating a set of links...
foreach($aLinks as $sLink) {
if ((pixelsize($sLink, $sFont, $iFontSize) . pixelsize($sHTML . " ", $sFont, $iFontSize)) < 400) {
$sHTML .= " " . $sLink;
} else {
$sHTML .= "<br />\n" . $sLink;
}
}
The goal is to keep the whole link on one and only one line letting
the browser automatically break up any given link.
Thanks,
Jim Carlock
Post replies to the newsgroup.
Navigation:
[Reply to this message]
|