Php-mysql Course

To chain a static and a public method through class name, for example:
className::staticMethod()->publicMethod()
The instance of the className must be returned in the staticMethod, using "return new self" .
- Code example:
<?php
class clsShow {
  public static $url;

  public static function setData(){
    self::$url = 'https://coursesweb.net/';
    return new self;
  }

  public function show(){
    echo self::$url;
  }
}

// accessing show() method after setData()
clsShow::setData()->show();             // https://coursesweb.net/

• To this page: PHP Method Chaining it is a lesson with more details and examples about chaining multiple methods.

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used to add definition lists into a <dl> element?
<dt> <dd> <li>
<dl>
 <dt>HTML</dt>
  <dd> - Hyper Text Markup Language</dd>
  <dd> - Language for web pages</dd>
</dl>
Which CSS property can hide an element on page, letting an empty space in its place?
display position visibility
#id {
  visibility: hidden;
}
Click on the event which is triggered when the mouse clicks on an object.
onclick onmouseover onfocus
document.getElementById("id").onclick = function(){
  alert("http://CoursesWeb.net/");
}
Indicate the PHP variable that contains the contents of both $_GET, $_POST, and $_COOKIE arrays.
$_SESSION $_GET $_REQUEST
if(isset($_REQUEST["id"])) {
  echo $_REQUEST["id"];
}
Chaining Static and Public Methods in PHP

Last accessed pages

  1. PHP-MySQL free course, online tutorials PHP MySQL code (56139)
  2. Integer and Float value in Select with PDO from string to numeric (6608)
  3. Get the Height and Width of web Page and browser Window (2175)
  4. PHP getElementById and getElementsByTagName (38789)
  5. AJAX Course, free Lessons (11525)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (483)
  2. Register and show online users and visitors (339)
  3. PHP-MySQL free course, online tutorials PHP MySQL code (252)
  4. JavaScript Course - Free lessons (250)
  5. querySelector and querySelectorAll (237)