[php] behaalde cijfer in input

Gestart doorJvdw3 reacties66 weergaven

4 berichten · pagina 1 van 1

Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

ik ben bezig met iets te maken om scores in te voegen van toetsen. Maar hoe doe ik dit het beste? Niet alle overhoringen staan op 10 punten, soms op 7 of 15 of wat dan ook.
hoe ik het zou doen is zoiets:
[input1] / [input2] > dan kan het 8 / 10 voorstellen.

Maar dat is best stom. Dus zoek ik iets dat ik volledig 8/10 kan invoegen in een input, maar hoe haal ik dan de cijfers met php voor het teken "/" en na het teken "/" op? Als dit tenminste al mogelijk is...

Maar alvast bedankt voor jullie hulp thumbsup
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
explode
0
Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$input[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"9/15"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$scheiden[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"/"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$input[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$getal1[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$scheiden[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]];[/COLOR] [COLOR= #FF8000]//Dit zal dus 9 zijn [/COLOR]
[COLOR= #0000BB]$getal2[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$scheiden[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]];[/COLOR] [COLOR= #FF8000]//Dit zal dus 15 zijn[/COLOR]
[COLOR= #0000BB]$nummeroptien[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$getal1[/COLOR] / [COLOR= #0000BB]$getal2[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Je behaalde [/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$nummeroptien[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000] op 10[/COLOR][COLOR= #007700];[/COLOR]
?>


Denk dat je het hiermee wel snapt wink
0
Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wouter schreef:
[COLOR= #0000BB]<?php
$input[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"9/15"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$scheiden[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"/"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$input[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$getal1[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$scheiden[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]];[/COLOR] [COLOR= #FF8000]//Dit zal dus 9 zijn [/COLOR]
[COLOR= #0000BB]$getal2[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$scheiden[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]];[/COLOR] [COLOR= #FF8000]//Dit zal dus 15 zijn[/COLOR]
[COLOR= #0000BB]$nummeroptien[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$getal1[/COLOR] / [COLOR= #0000BB]$getal2[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Je behaalde [/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$nummeroptien[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000] op 10[/COLOR][COLOR= #007700];[/COLOR]
?>
Denk dat je het hiermee wel snapt wink
dankjewel! biggrin
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren