Nitish Kumar
Recent Posts by Nitish Kumar
How Can I Get the Full URL of Current Page in PHP?
There are a lot of situations where you might need to get the URL of a webpage that any user might be currently visiting. For instance, a project may require you to dynamically generate the title of a webpage based on its URL. There are many ways in which we can obtain the URL of […]
How Can I Get the First Element of an Array in PHP?
Getting the first element of an array seems like a simple thing to do. For simple arrays with sequential numeric keys it is actually very easy. However, the problem is in getting the first element of an array without any knowledge of its keys. In this article, we will go over six different methods that […]
How Can I Get the Current Date and Time in PHP?
Let’s say you are working on a project that requires you to get the current date and/or time in PHP. In this tutorial, you will learn about different methods that can be used to get the current date or time with or without timezones. Get the Current Date Using the date() Function The date() function […]
How Can I Generate a Random Alphanumeric String in PHP?
The need to generate a unique random alphanumeric string of a given length is very common. You may need it for various purpose like creating a random username or a filename. In this article, you will learn about different methods that can be used to generate random alphanumeric string in PHP. Using str_shuffle() to Generate […]
How Can I Do a Redirect to Different URL Before Page Load?
Let’s say that you want all the visitor on the webpage https://example.com/initial.php to https://example.com/final.php. This can be done using several methods that involve PHP, JavaScript and HTML. In this article, you will learn about all three different techniques that can be used to redirect your visitors from one webpage to another. Here are a few […]