Nitish Kumar

Recent Posts by Nitish Kumar

PHP DateTime Class Methods

DateTime class Methods in PHP Function Name Function Description DateTime::add() Adds an amount of days, months, years, hours, minutes and seconds to a DateTime object DateTime::__construct() Returns new DateTime object DateTime::createFromFormat() Parses a time string according to a specified format DateTime::createFromImmutable() Returns new DateTime object encapsulating the given DateTimeImmutable object DateTime::getLastErrors() Returns the warnings and […]

PHP DatePeriod Class Methods

DatePeriod class Methods in PHP Function Name Function Description DatePeriod::__construct() Creates a new DatePeriod object DatePeriod::getDateInterval() Gets the interval DatePeriod::getEndDate() Gets the end date DatePeriod::getRecurrences() Gets the number of recurrences DatePeriod::getStartDate() Gets the start date PHP DatePeriod::__construct() Method What does DatePeriod::__construct() do? The PHP DatePeriod::__construct() method creates a new DatePeriod object. PHP DatePeriod::__construct() Syntax PHP […]

How Can I Remove or Delete Empty Array Elements in PHP?

Many times, when working on a PHP project, you deal with an array which has some unwanted or empty array elements. This is especially true if you have no control over the values populated into the array. For example, you might have to store user input into an array and some of that input might […]

How Can I Check if an Element is Hidden or Visible with JavaScript?

Using JavaScript or jQuery to check if an element is hidden or not sounds very simple. However, there are lot of things that you need can determine the final outcome of such a check. For instance, everyone will have a doing criteria for determine if an element is hidden or visible. In some projects, an […]

Get the Current Date and Time in JavaScript

There are a lot of scenarios where you might want to get the current date and time in JavaScript. For instance, you might be creating a website where you want to change the theme based on time of the day like setting a dark theme at night or you might simply want to display the […]

0%