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 tag can be used to create input text field in web page?
<form> <input> <div><input type="text" name="a_name" value="val" />
Which CSS property displays the text in a small-caps font?
display font-variant font-styleh3 {
font-variant: small-caps;
}
What instruction displays a notice box with a message inside it, in JavaScript?
for() Date() alert()var msg = "Visit CoursesWeb.net";
alert(msg);
Indicate the PHP code used to get the users IP.
$_SERVER["HTTP_USER_AGENT"] $_SERVER["REMOTE_ADDR"] $_GET[]$ip = $_SERVER["REMOTE_ADDR"];
echo $ip;