PHP reads 1.10 value as 1.1 (0 at end of variable not honored)

Posted by adbox on Stack Overflow See other posts from Stack Overflow or by adbox
Published on 2010-03-21T22:57:43Z Indexed on 2010/03/21 23:01 UTC
Read the original article Hit count: 247

Filed under:

Hello,

This is hard for me to word, but easier for me to demonstrate:

I have a select option:

<option <?php if($frequency[$key]=='1.10'){echo "selected";}?> value='1.10'>1 every 10 days</option>

Really, $frequency[$key]=1.1; , but the above still shows up selected. I've never seen this before, and didnt know it could happen. Any ideas on how to prevent this?

Working with php5. Thank you, Hudson

© Stack Overflow or respective owner

Related posts about php5