Jump to content

[SOLVED] How to get form elements to recursivly generate via php code


Recommended Posts

Here is my form code, I am unsure of how to achieve and if someone can point me in the right direction to doing that would be great. Here is my form code:

 

<?php
if ($varPrevHeight =='4') {
echo "<option selected=\"selected\" value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='4.1') {
echo "<option value=\"4\">4ft</option>
<option selected=\"selected\" value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='4.2') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option selected=\"selected\" value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='4.3') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option selected=\"selected\" value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='4.4') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option selected=\"selected\" value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='4.5') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option selected=\"selected\" value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='4.5') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option selected=\"selected\" value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='4.7') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option selected=\"selected\" value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='4.8') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option selected=\"selected\" value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='4.9') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option selected=\"selected\" value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='4.10') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option  selected=\"selected\" value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='4.11') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option  selected=\"selected\" value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='5') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option selected=\"selected\" value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='5.1') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option selected=\"selected\" value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='5.2') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option selected=\"selected\" value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='5.3') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option selected=\"selected\" value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='5.4') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option selected=\"selected\" value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='5.5') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option selected=\"selected\" value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='5.6') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option selected=\"selected\" value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='5.7') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option selected=\"selected\" value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='5.8') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option selected=\"selected\" value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='5.9') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option selected=\"selected\" value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='5.10') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option selected=\"selected\" value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='5.11') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option selected=\"selected\" value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='6') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option selected=\"selected\" value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='6.1') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option selected=\"selected\" value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='6.2') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option selected=\"selected\" value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='6.3') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option selected=\"selected\" value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} elseif ($varPrevHeight =='6.4') {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option selected=\"selected\" value=\"6.4\">6ft 4in</option>
<option value=\"6.5\">6ft 5in</option>";
} else {
echo "<option value=\"4\">4ft</option>
<option value=\"4.1\">4ft 1in</option>
<option value=\"4.2\">4ft 2in</option>
<option value=\"4.3\">4ft 3in</option>
<option value=\"4.4\"> 4ft 4in</option>
<option value=\"4.5\">4ft 5in</option>
<option value=\"4.6\">4ft 6in</option>
<option value=\"4.7\">4ft 7in</option>
<option value=\"4.8\">4ft 8in</option>
<option value=\"4.9\">4ft 9in</option>
<option value=\"4.10\">4ft 10</option>
<option value=\"4.11\">4ft 11in</option>
<option value=\"5\">5ft</option>
<option value=\"5.1\">5ft 1in</option>
<option value=\"5.2\">5ft 2in</option>
<option value=\"5.3\">5ft 3in</option>
<option value=\"5.4\">5ft 4in</option>
<option value=\"5.5\">5ft 5in</option>
<option value=\"5.6\">5ft 6in</option>
<option value=\"5.7\">5ft 7in</option>
<option value=\"5.8\">5ft 8in</option>
<option value=\"5.9\">5ft 9in</option>
<option value=\"5.10\">5ft 10in</option>
<option value=\"5.11\">5ft 11in</option>
<option value=\"6\">6ft</option>
<option value=\"6.1\">6ft 1in</option>
<option value=\"6.2\">6ft 2in</option>
<option value=\"6.3\">6ft 3in</option>
<option value=\"6.4\">6ft 4in</option>
<option selected=\"selected\" value=\"6.5\">6ft 5in</option>";
}

?>

 

Thanks Guys!!!!!!!! ??? 8);D

I got bored, so here's whats more than likely overkill code for you (dynamically generated list with option selected):

<?php
// Set defaults:
$min = 4;               // where the select box should start
$max = 6.5;             // where the select box should end

// Fake user input:
$input = 4.14;

function getData($input) {
        // Check for a decimal point
        if(!substr_count($input, '.')) {
                // If not, its just the feet, 0 inches
                $feet = $input;
                $inches = 0;
        } else {
                // otherwise, we need to do more checking, first we'll explode at the decimal point
                $temp = explode('.', $input);
               
                // Is the place past the decimal point above 11 inches (or another foot?)
                if($temp[1]>11) {
                        // if yes, then we need to figure out how many extra feet it will be
                        $feet = (int) ($temp[1]/12) + $temp[0];
                        // and get the remainder
                        $inches = $temp[1]%12;
                } else {
                        // Otherwise, it's okay and we'll just use what they gave us
                        $feet = $temp[0];
                        $inches = $temp[1];
                }
        }
        // return the items in an array
        return array($feet, $inches);
}

// Get the data prepared:
$data = getData($input);
$min = getData($min);
$max = getData($max);

// start the select box:
echo '<select>';

// Start loop for feet - from min to max
for($i=$min[0]; $i<=$max[0]; $i++) {

        // if this is the min, we should tell it where to start at for inches:
        if($i==$min[0]) {
                $j = $min[1];
        } else {
                $j = 0;
        }
        // if this is the max, we should tell it where to end at for inches:
        if($i==$max[0]) {
                $k = $max[1];
        } else {
                $k = 11;
        }
       
        // Now we need to start the inches counter:
        for($ii = $j; $ii<=$k; $ii++) {
       
                // Start the option, with the foot value
                echo '<option value="',$i;
               
                // If the inches are not 0, we should put them in the value as foot.inch
                if($ii != 0) {
                        echo '.',$ii;
                }
               
                // Close the value quote
                echo '"';
               
                // If it is the user's value, show as selected
                if($i==$data[0] && $ii==$data[1]) {
                        echo ' selected="selected"';
                }
               
                // Close the opening option tag and show fow many feet
                echo '>',$i,'ft';
               
                // Again, if the inch value isn't 0, show it (plus in at the end)
                if($ii != 0) {
                        echo ' ',$ii,'in';
                }
               
                // Close option tag
                echo '</option>';
        }
}

// Close select tag
echo '</select>';
?>

<?php 
$varPrevHeight = 5.2; // example
for ($f = 4; $f <= 6; $f++) {
  for ($fi = $f; $fi < ($f+.11); $fi += .01) {
    if ($fi == 6.06) break;
    $fi = sprintf("%01.2f", $fi);
    $t = explode('.',$fi);
    $value = $t[0] . (($t[1] && $t[1] > 0)? '.' . ltrim($t[1],'0') : ''); 
    $option = $t[0] . 'ft' . (($t[1] && $t[1] > 0)? ' ' . ltrim($t[1],'0') . 'in' : ''); 
    $selected = ($value == $varPrevHeight)? " selected='selected'" : "";
    echo "<option value='$value'$selected>$option</option>";
  }
}

Thanks guys, I really just needed to be pointed to a starting point but I appreciate the code. I pretty much get King phillips but I have a question for you Crayon Violent, I am wondering what is going on with

$fi = sprintf("%01.2f", $fi);

 

I understand that sprintf is used for altering strings and I understand that f is for floating point but I do not get what the % sign does. Could you elaborate on that line some.

 

Thanks

 

the '%' basically tells sprintf() where a special formatting string starts, and the letter on the end terminates it. anything else around it would get printed exactly as entered (unless of course it's another formatting string).

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.