<?php
$lastDay = date(‘t’,strtotime(‘today’));
echo $lastDay;
?>
Tag Archives: PHP
PHP Previous Date
<?php
echo $prev_date = date(‘Y-m-d’, strtotime(date(‘Y-m-d’) .’ -1 day’));
echo $next_date = date(‘Y-m-d’, strtotime(date(‘Y-m-d’) .’ +1 day’));
?>
PHP Encapsulation
The wrapping up of data and methods into a single unit (called class) is known as encapsulation. Encapsulation is a protection mechanism for the data members and methods present inside the class. In the encapsulation technique, we are restricting the data members from access to outside world end-user.
In PHP, encapsulation utilized to make the code more secure and robust. Using encapsulation, we are hiding the real implementation of data from the user and also does not allow anyone to manipulate data members except by calling the desired operation.
Variable pools PHP
Variable pools are functional groupings of variables within Service Manager. There are currently four variable pools
Global
A global variable is visible to the entire system. It begins with $G. or $lo..
Local
A local variable is only visible to the RAD application in which it was defined. It begins with $L..
Parameter
A parameter variable is defined on a parameter command panel. It may contain a value passed in from another application. By convention, parameter variables are written in uppercase letters, such as $PHASE or $GROUP.LIST. Parameter variables are invisible to the debugger.
Thread
A thread variable is only visible to the thread in which it was defined. The same variable in different threads has different values, even when the threads are spawned by the same parent.
Defining Variable JavaScript
There are three ways of defining a variable in JavaScript:
Var
This is used to declare a variable and the value can be changed at a later time within the JavaScript code.
Const
We can also use this to declare/define a variable but the value, as the name implies, is constant throughout the JavaScript program and cannot be modified at a later time.
Let
This mostly implies that the values can be changed at a later time within the JavaScript code.
JavaScript Advantages
These are the advantages of JavaScript:
Enhanced Interaction
JavaScript adds interaction to otherwise static web pages and makes them react to users’ inputs.
Quick Feedback
There is no need for a web page to reload when running JavaScript. For example, form input validation.
Rich User Interface
JavaScript helps in making the UI of web applications look and feel much better.
Frameworks
JavaScript has countless frameworks and libraries that are extensively used for developing web applications and games of all kinds.
Features JavaScript
These are the features of JavaScript:
- Lightweight, interpreted programming language
- Cross-platform compatible
- Open-source
- Object-oriented
- Integration with other backend and frontend technologies
- Used especially for the development of network-based applications
JavaScript Properties
Properties are the values associated with a JavaScript object.
A JavaScript object is a collection of unordered properties.
Properties can usually be changed, added, and deleted, but some are read only.
JavaScript Output
JavaScript can “display” data in different ways:
Writing into an HTML element, using innerHTML.
Writing into the HTML output using document.write().
Writing into an alert box, using window.alert().
Writing into the browser console, using console.log().
LET Javascript
The let keyword was introduced in ES6 (2015).
Variables defined with let cannot be Redeclared.
Variables defined with let must be Declared before use.
Variables defined with let have Block Scope.