Php-mysql Course

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-style
h3 {
  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;
Zodiac Signs PHP code

Last accessed pages

  1. Laravel Basic Architecture (1171)
  2. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (137679)
  3. PHP getElementById and getElementsByTagName (49166)
  4. PHP PDO - Select query, fetch (29178)
  5. SBMD - Simple Backup MySQL Database (5004)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (368)
  2. Read Excel file data in PHP - PhpExcelReader (137)
  3. The Four Agreements (101)
  4. PHP Unzipper - Extract Zip, Rar Archives (101)
  5. The Mastery of Love (97)