';
// This surrounding div allows us to add a pseudo alt and title tag
// If no alt tag is specified then it won't be displayed
if($alt != '') {
echo '
' . $alt . '';
} else {
echo '
';
}
foreach ($sandbag as $position => $blankPixels) {
$sandbagWidth = $width-$blankPixels;
$yPos = $position*$sandbagHeight;
$xPos = $blankPixels;
if ($position == 0) {
$sandbagClass .= ' first-sandbag';
} elseif ($position == count($sandbag)-1) {
$sandbagClass .= ' last-sandbag';
$sandbagHeight = $finalSectionSize; // as the final sandbag, this may get a special size!
}
printf($sandbagTemplate,$imageName,$xPos,$yPos,$sandbagWidth,$sandbagHeight);
}
echo '
';
}
// We incorporate the ALT tag into our function call
alignedImage('an_image.png', 'A right aligned blob', 15);
?>