I have a database with member ID values. (always 8 digits long)
If member is on the pay list there is a “SI” prefix added to the ID.
For example:
John: 12345678
Jack: SI87654321
Now i would like to write a function which checks if there is “SI” at the beginning of the number. (Some kind of regular expression which extracts the “SI” from the number)
If yes -> return ID number (without SI), YES radio button is checked. (checked=”checked”)
If not -> return ID number, NO radio button is checked. (checked=”checked”)
example:
PHP:
$ID = get from database (for example: SI12345678)
function check () {return $pureNumber}
HTML:
<body>
<?php echo $pureNumber ?><br/>
<label for="dz1"><input type="radio" value="SI" name="davzav" id="dz1"/>YES(SI)</label>
<label for="dz2"><input type="radio" value="" name="davzav" id="dz1"/>NO</label>
</body>
Thanks for your help
You could just check the first two characters: