Hey one2xs,
Vandaag ben ik maar eens bezig gegaan om te scripten in OOP.
En dit is dus mn eerste class, een script dat check of het getal even of oneven is:
Het is voor de duidelijkheid NIET de bedoeling dat je dit gaat kopiëren, ik vraag alleen voor eventuele tips / opmerkingen
Ga A.U.B. niet met onzin reacties antwoorden.
Groeten,
Nielsjojo
Vandaag ben ik maar eens bezig gegaan om te scripten in OOP.
En dit is dus mn eerste class, een script dat check of het getal even of oneven is:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/class"]class[/URL] Getal
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] EvenCheck[COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR]is_nummeric[COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]%[/COLOR] [COLOR= #0000BB]2[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Getal is even![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Getal is oneven![/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Dit is geen getal =O[/COLOR][COLOR= #007700];
}
}
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] Getal[COLOR= #007700]::[/COLOR]EvenCheck[COLOR= #007700]([/COLOR][COLOR= #0000BB]24868[/COLOR][COLOR= #007700]);[/COLOR]
?> Het is voor de duidelijkheid NIET de bedoeling dat je dit gaat kopiëren, ik vraag alleen voor eventuele tips / opmerkingen
Ga A.U.B. niet met onzin reacties antwoorden.
Groeten,
Nielsjojo


