Found 6 Questions For Server Side Programming

PHP Date and Time Function

Updated on 26-Jan-2023 14:42:35
In this tutorial, we will see how to get the date & time using the date() & time() function in PHP, we will also see the various formatting options available with these functions & understand their implementation through the examples.Date and time are some of the most frequently used operations in PHP while executing SQL queries or designing a website etc. PHP serves us with predefined functions for these tasks. Some of the predefined functions in PHP for date and time are discussed ... Read More

What does ‘<?=’ short open tag mean in PHP ?

Updated on 26-Jan-2023 14:40:35
The <?php is used to identify the start of a PHP document.In PHP whenever it reads a PHP document, It looks for:<?php ?> It process the codes in between the above tags only and leaves the other codes around them.For example :<?php     echo "Hello PHP !"; ?> Output :Hello PHP !Note : But a special case is when you write a PHP file the end tag can be omitted, Only the start tag is needed.The below code works fine as well:<?php    echo ... Read More

See (stage) your website before switching your DNS

Updated on 01-Nov-2021 9:06:42
When customers are looking to switch hosting providers, they usually stage the setup of their web site before completely switching the DNS (domain name servers). We provide you with a temporary URL so that you can see how your site will look before you switch your domain’s DNS. The problem comes when some scripts require you to access the script through a valid domain name. This poses an issue because you haven’t switched the domain’s DNS and don’t want to until you know the script works... Read More

How can we create recursive functions in Python?

Updated on 30-Oct-2021 14:38:44
Recursion is a programming method, in which a function calls itself one or more times in its body. Usually, it is returning the return value of this function call. If a function definition follows recursion, we call this function a recursive function. Also Read : How to get a list of parameter names inside Python function? A recursive function has to terminate to be used in a program. It terminates, if with every recursive call the solution of the problem is becomes smaller and moves towards ... Read More

How to make a chain of function decorators in Python?

Updated on 03-Oct-2021 13:57:46
Decorators are “wrappers”, which allow us to execute code before and after the function they decorate without modifying the function itself. Example The given code can be wrapped in a chain of decorators as follows. def makebold(fn): def wrapped(): return "" + fn() + "" return wrapped def makeitalic(fn): def wrapped(): return "" + fn() + "" return wrapped @makebold @makeitalic def hello(): return "hello world" print hello() Output C:/Users/code... Read More

What are Python function attributes?

Updated on 03-Oct-2021 13:29:18
Everything in Python is an object, and almost everything has attributes and methods. In python, functions too are objects. So they have attributes like other objects. All functions have a built-in attribute __doc__, which returns the doc string defined in the function source code. We can also assign new attributes to them, as well as retrieve the values of those attributes. For handling attributes, Python provides us with “getattr” and “setattr”, a function that takes three arguments.... Read More