Formatting output



Hi All,

Using Version 4.3.9 (Stuck with it for now).

Anyhow, I am trying to do formatted output of single digit decimals. I have a form and present you an abbreviated example for getting a month value.

<select class="inform" name="logmonth">
<option value="1">Jan</option>
<option value="2">Feb</option>
<option value="3">Mar</option>
</select>

and upon submit it runs through another php process

//variable set
$logmonth = $_POST[logmonth];

//and my attempt to format the output
fwrite($out,"%02d\n",$logmonth);

so that it will write to a file

and put a leading 0 in front of single digit months.

Example, for February the output to the file would be 02.

The fwrite doesn't seem to work.

Any suggestions would be appreciated.

Thanks

--
Patrick A. Smith Assistant System Administrator
Ocean Circulation Group – USF - College of Marine Science
http://ocgweb.marine.usf.edu Phone: 727 553-3334

The trouble with doing something right the first time is that nobody
appreciates how difficult it was. - La Rochefoucauld
.