Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function greet($name, $owner) {
- return $name == $owner ? "Hello boss" : "Hello ${name}";
- }
- function isOrdered($a,$b,$c) {
- return ( ( $a < $b && $b < $c ) || ( $a > $b && $b > $c ) );
- }
- function getDay($day) {
- $dayF = --$day;
- $days = [
- "Lundi",
- "Mardi",
- "Mercredi",
- "Jeudi",
- "Vendredi",
- "Samedi",
- "Dimanche"
- ];
- return isset( $days[$dayF] ) ? $days[$dayF] : "Ce jour n'existe pas";
- }
- function getSeason($month) {
- if ( $month > 12 || $month < 1 )
- die ("This month doesnt exist");
- switch(true) {
- case $month:
- echo "Winter";
- break;
- case 4:
- case 5:
- case 6:
- echo "Printemps";
- break;
- case 7:
- case 8:
- case 9:
- echo "Ete";
- break;
- case 10:
- case 11:
- case 12:
- echo "Automne";
- break;
- }
- }
- //echo greet("robin", "robin");
- //var_dump( isOrdered(3, 6, 1) );
- //echo getDay(1);
- //getSeason( 0 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement