How can I format this code block so that every time this loop happens,
it moves each hyperlink element 20px from the left?
It’s working at the moment but for the whole div not single items.
Example:
– LINK 1
— LINK 2
— LINK 3
Any help would be appreciated!
$linkArray = array();
$thisDir = '';
$baseDir = ($htmlRoot == '') ? '' : $htmlRoot;
for ($n=0; $n<count($dirArray); $n++) {
$thisDir .= $dirArray[$n].'/';
$thisIndex = MPBCDirIndex($htmlRoot.$thisDir);
$thisText = ($n == 0) ? $topLevelName : MPBCFixNames($dirArray[$n]);
$thisLink = ($thisIndex != '') ? '<span style="padding-left:20px;"><a href="'.$thisDir.$thisIndex.'">'.$thisText.'</a></span>' : $thisText;
if ($thisLink != '') $linkArray[] = $thisLink;
}
$results = (count($linkArray) > 0) ? implode($separator, $linkArray) : '';
Well hmmm. You are already counting your iterations with the $n variable. SO:
EG.
Note: the first iteration will have a padding of 0px. Not sure if thats how you want it?