You can do it by controlling the width of a div via css. Something roughly along these lines:
<div id="container" style="width:100%; height:50px; border:1px solid black;">
<div id="progress-bar" style="width:50%;/*change this width */
background-image:url(someImage.png);
height:45px;">
</div>
</div>
That width value can be sent in from php if you so desire.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…