reza_alie
دوشنبه 10 فروردین 1394, 20:02 عصر
خدمت دوستان
<html>
<head>
<style type="text/css">
.bar {
background:#33F;
color: #fff;
height: 20px;
width: auto;
min-width: 2px;
clear: both;
margin-bottom: 5px;
padding: 5px;
font-weight: bold;
}
</style>
</head>
<body>
<?php
$vals = array(
'dell' => 12,
'asus' => 55,
'samsung' => 40,
'hp' => 1400,
'fujistu' => 20,
);
foreach ($vals as $key => $val) {
$test=floatval(($val/100));
echo $test;
echo'<br>';
echo('<div class="bar" style="width: '.$test.'px" title="'.$key.' = '.$test.'">'.$key."</div>");
}
?>
</body>
</html>
<html>
<head>
<style type="text/css">
.bar {
background:#33F;
color: #fff;
height: 20px;
width: auto;
min-width: 2px;
clear: both;
margin-bottom: 5px;
padding: 5px;
font-weight: bold;
}
</style>
</head>
<body>
<?php
$vals = array(
'dell' => 12,
'asus' => 55,
'samsung' => 40,
'hp' => 1400,
'fujistu' => 20,
);
foreach ($vals as $key => $val) {
$test=floatval(($val/100));
echo $test;
echo'<br>';
echo('<div class="bar" style="width: '.$test.'px" title="'.$key.' = '.$test.'">'.$key."</div>");
}
?>
</body>
</html>