What’s new in PHP 8.2
PHP 8.2 will be released on November 24, 2022. In this post, we’ll go through all features, performance improvements, changes, and deprecations one by one. Readonly classes rfc This RFC builds on top of them and adds syntactic sugar to make all class properties readonly at once. Instead of writing this: You can now write this: Functionally, making…
How to trigger a button click from another button click event with JavaScript?
Sometimes, we want to trigger a button click from another button click event with JavaScript. In this article, we’ll look at how to trigger a button click from another button click event with JavaScript. To trigger a button click from another button click event with JavaScript, we call the element click method. For instance, we write to…
Read More “How to trigger a button click from another button click event with JavaScript?” »
How to Object Destructuring in ES6
This is a follow-up article to my previous article on Array Destructuring. Except you have an idea of destructuring, you should read it. First, let’s see why object destructuring is needed. We want to extract data from the object and assign it to new variables. Before ES6, how would this happen? See how tedious it is…
How to Define Global Variables for Twig Templates in Symfony 6
Sometimes we may need to inject the same variable in all the Twig templates. It can be done on each controller by passing a variable to template. However, it is not a good solution. This tutorial shows how to define global variables for Twig templates in Symfony 6 application. Global variables for Twig templates can…
Read More “How to Define Global Variables for Twig Templates in Symfony 6” »
How to Create Live Search in HTML table with jQuery
This tutorial shows you client-side searching in an HTML table with jQuery this is a very simple and easy code snippet you can use it in small apps reporting where you want to add fast searching you can use this code snippet as a 10-line of code to make a simple. The code for this…
Read More “How to Create Live Search in HTML table with jQuery” »
How to change the link color of the current page with CSS?
Sometimes, we want to change the link color of the current page with CSS. In this article, we’ll look at how to change the link color of the current page with CSS. To change the link color of the current page with CSS, we set the color background-color properties. For instance, we write to set the text color…
Read More “How to change the link color of the current page with CSS?” »
ES6 classes
Prior to ES6, classes have been in use in Javascript. ES6 just comes with a clean, nice-looking syntax for defining classes. It’s good to note that JavaScript’s class is just a more convenient way of creating constructor functions, which are very different from traditional classes. In this article, we will focus on: How to define…
10 Programming Habits that every Developer Should Adopt
Write Human-Friendly Code Always remember that you are not writing code for machines but for others too. So it is essential to come up with a readable code. It is true that programming is like writing a good poem. The tone should be very consistent, the words should be descriptive & sentence well-structured. Here are…
Read More “10 Programming Habits that every Developer Should Adopt” »
How to check the PHP version
Newer PHP versions come with more features and improvements while deprecating some obsolete features. Old PHP codes might not work with more recent PHP versions and vice versa. It is, therefore, essential to use the correct PHP version for your code. You can check the PHP version on your system by running the php command from the command line. There are also some PHP functions that you can use…
Difference Between Git and GitHub
Git and GitHub are the same and serve the same purpose, but this is not the case. Git is a version control system used to manage different versions of our project whereas GitHub is a Git repository hosting service. Git- Git is a very popular version control system used to manage projects. However, a version…
How to Check Twig Version in Symfony
Finding out which version of the Twig you have installed in Symfony framework can be useful when solving bugs or installing packages. This tutorial shows how to check Twig version in Symfony. We can use the Environment::VERSION constant to determine Twig version. test.php This constant can be used in the template as follows: templates/test/index.html.twig
How to change password in the CodeIgniter framework
How to send forgot password in CodeIgniter framework PHP. Here we using 2 files to insert data in MySQL: Forms.php Path: codeIgniter\application\controllers\Forms.php forgot_pass.php Path: codeIgniter\application\views\change_pass.php Forms.php (Controller) <?php class Forms extends CI_Controller { public function __construct() { parent::__construct(); $this->load->database(); $this->load->library(‘session’); $this->load->helper(‘url’); $this->load->model(‘Hello_model’); } public function forgot_pass() { if($this->input->post(‘forgot_pass’)) { $email=$this->input->post(’email’); $que=$this->db->query(“select pass,email from user_login where email=’$email'”); $row=$que->row();…
Read More “How to change password in the CodeIgniter framework” »
How to make the scrollbar visible in mobile browsers with CSS?
Sometimes, we want to make the scrollbar visible in mobile browsers with CSS. In this article, we’ll look at how to make the scrollbar visible in mobile browsers with CSS. To make the scrollbar visible in mobile browsers with CSS, we set the scrollbar’s width. For instance, we write to set the vertical width of…
Read More “How to make the scrollbar visible in mobile browsers with CSS?” »
How to clear your cache in npm
If you ever get weird errors in npm like Please run npm cache clean you may need to clean or refresh your npm cache. To fix this, you can try running npm cache clean. Run: “npm cache verify” for npm version 5 and up However if you’re running npm v5 and above, npm is supposed to be self-healing,…
Understanding State in React Components
A difference between state and props is that while the data stored by props are fixed throughout their lifetime, state store data that can be changed over time. This change can be in response to user actions, network responses, or anything. Also, while props are set by the parent component, state is changed internally by the component itself. A component’s state should be considered private data. This…
How to Search Recently Modified Files in Linux
This post will help you to find recently modified files in Linux via the command line. The find command works with, defining duration in Minutes or Days. The minutes are defined with -mmin and the day’s value can be defined with -mtime You can also define the search criteria to find files modified within or before the specified…
Read More “How to Search Recently Modified Files in Linux” »
How To Install Nginx, PHP on Ubuntu 22.04
Now, Open a terminal and start following the below steps. Step 1 . Install Ngnix. our system is updated now we will install Nginx. Ngnix is installed, Now we will configure the firewall, we will allow port 80 and port 443. Now open your IP in the web browser you will see the output, If…
How to Enable Debug Mode in Laravel
Debugging is a helpful feature for developers to identify the causes of issues. Most modern application frameworks allow you to enable debug mode, including Laravel. It is a good idea to keep enabling debug mode in your development environment. In your production environment, this value should always be false. This tutorial help to enable/disable debug…
Common Mistakes with Conditionals
This article will go over some mistakes that are easy to make when writing more complex programs with conditional. Mistake 1: Not treating expressions as distinct:Let’s say we want to print something if your variable $num is equal to 1 or 2 or 3. Why doesn’t the following code work? $num = 5; if ($num === 1 || 2 || 3) {…
How to Convert PHP CSV to JSON
JSON format is a widely used format when dealing with API development. Most of the existing API responses are in JSON format. Converting CSV content to JSON format in PHP is easy. In this article, we will look at various methods of achieving this conversion. The above quick example in PHP converts the CSV file…