van/tot in php

Gestart doorTom8 reacties28 weergaven

9 berichten · pagina 1 van 1

Tom

Lid · Topicstarter

Berichten
3.868
Reputatie
0
Punten
0,02
Lid sinds
Laatst gezien
Ik wil eventjes snel weten hoe je in php iets kan, minimaler nummer, maximale nummer.

Hoe heet die functie daarvan?
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
min() en max() ?
0
Tom

Lid · Topicstarter

Berichten
3.868
Reputatie
0
Punten
0,02
Lid sinds
Laatst gezien
Weet ik niet, ik ga het even proberen.
Is er niet een functie waarbij je dit krijgt:
functienaam(minimaal, maximaal), waarbij dus de naam van de functie functienaam is wat ik zoek.
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
range?

$numbers = range(1, 99);

Krijg je een array met de nummers 1 totenmet 99 ?
0
Berichten
1.544
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Zo?
function minmax($getal,$min,$max){
   if($getal >= $min AND $getal <= $max){
      return TRUE;
   }else{
      return FALSE;
   }
}


Niet getest hoor.
0
Berichten
1.056
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]//Maximum minimum arrays berekenensort($sortiment);[/COLOR]
[URL="http://www.php.net/sort"]sort[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/sort"]sort[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sortiment[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Maximum sortiment: "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/max"]max[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sortiment[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]"<br>"[/COLOR][COLOR= #007700];[/COLOR][COLOR= #FF8000]//eerste[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"minimum sortiment: "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/min"]min[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sortiment[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]"<br><br>"[/COLOR][COLOR= #007700];[/COLOR][COLOR= #FF8000]//laatste[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"maximum aantal: "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/max"]max[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]"<BR>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"minimum aantal: "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/min"]min[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700]);[/COLOR]
?>


Bedoel je zoiets?
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
sort() is niet nodig he dan hypocrite
0
Berichten
1.056
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oke, als jij dat zecht geloof ik je direct, ik heb dit volgens mij gewoon ooit uit een boek over geschreven.
0
Tom

Lid · Topicstarter

Berichten
3.868
Reputatie
0
Punten
0,02
Lid sinds
Laatst gezien
Het is al opgelost, bedankt iedereen.
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