A simple PHP function that returns the zodiac sign according to day and month.
-
Click to select it.
<?php
function zodiac($day, $month) {
// returns the zodiac sign according to $day and $month ( https://coursesweb.net/ )
$zodiac = array('', 'Capricorn', 'Aquarius', 'Pisces', 'Aries', 'Taurus', 'Gemini', 'Cancer', 'Leo', 'Virgo', 'Libra', 'Scorpio', 'Sagittarius', 'Capricorn');
$last_day = array('', 19, 18, 20, 20, 21, 21, 22, 22, 21, 22, 21, 20, 19);
return ($day > $last_day[$month]) ? $zodiac[$month + 1] : $zodiac[$month];
}
// 15 - October
echo zodiac(15, 10); // Libra
Daily Test with Code Example
HTML
CSS
JavaScript
PHP-MySQL
Which attribute is used in <img> tag for the address of the image?
href src rel<img src="http://coursesweb.net/imgs/webcourses.gif" width="191" height="63" alt="Courses-Web" />
Which CSS code hides the element on page?
display: none; display: inline; position: relative;#id {
display: none;
}
What instruction stops the execution of a while() or for() statement?
continue prompt() breakfor(var i = 0; i< 8; i++) {
if(i > 1) break;
alert(i);
}
Indicate the function that can create a constant.
define() include() defined()define("CONSTANT_NAME", "value");
echo CONSTANT_NAME;