How to create multiple database connections in Lumen.
Last week I was working on a project in which I need multiple Database connections. I need one separate database connection for reporting (Only for a read operation) and another for the rest of the work (Read & write both).
Write a program to check whether two strings are anagrams of each other.
What is an Anagram ?
Two strings are said to be anagrams of each other if it contains the same characters, only the order of characters in both the strings is different. In other words, both strings must contain the same exact letters in the same exact frequency.
How to debug SQL queries in Laravel & Lumen. During development of an application, there may be times when we need to write large and complex queries. Laravel provides an awesome query builder and ORM (Eloquent) to do this task effortlessly. But sometimes we would like to see the actual SQL being generated.
How to check if a number is a power of 2. To understand this question, let’s take some example.
Input – 16 – 16 is a power of 2 (2^4).
Input – 15 – 15 is not a power of 2.
Input – 32- 32 is a power of 2 (2^5).
We can use multiple approaches to check whether a number is a power of 2 or not.
Write a script to reverse a string in PHP without using strrev() method. In PHP, we can reverse a string easily using strrev() method. But think how will you reverse a string without using an inbuilt strrev() method.
How to create SEO-Friendly URLs with htaccess . How to Rewrite dynamic URLs to SEO-Friendly URLs using htaccess . In this URL rewriting tutorial, You’ll learn htaccess directives through which you can rewrite existing dynamic URLs into more meaningful SEO-Friendly URLs.
Now you are thinking why we need to create SEO-friendly URLs, what’s their need. First, let’s understand why SEO-friendly URLs are important.
Late Static Binding is a very important concept in PHP. In this tutorial, We’ll learn what is late static binding and how to use this concept.
In PHP, late static binding is used to reference the called class in the context of static inheritance.
Write a program to find maximum subarray sum in an array. Given an array of N elements, find the maximum possible sum of a contiguous subarray. An array can contain both positive and negative values.
Write a program to delete a node at Nth position from Linked List. Given a linked list, we have to write a method to delete a node from Nth position.
Program to delete a complete linked list
How to deny access to files, folders through htaccess file. In this tutorial, We are going to learn .htaccess directives through which we can deny direct access to files and folders.
How to Deny Access to Files, Folders through htaccess
What is .htaccess File?
.htaccess is a configuration file used by a web server (Apache). The full form of htaccess is Hypertext Access. Htaccess files are used to override server global configuration for the directory level in which you place this file.