المشاركات

How to Merge Two JSON Strings into One with PHP

صورة
Hi! In this tutorial we will see how to merge two json strings into one in php . People often mistakes JSON for object or array but it's the string representation of a JavaScript object. In a recent project, I wanted to combine two jsons. That is, I have to make two API calls and combine their results into one. It is a rest api and returns the response as json. The task is simpler than I thought. It employs a similar technique I used here earlier when dealing with json. Let me show you how to do it. PHP - Merging Two JSON into One: If you are new to working with JSON, don't worry. PHP offers native functions to handle it easily. The idea is to decode the json data, write it to an array and encode it back to json. Below are the steps involved in the process. STEP-1) Let's take two different jsons containing couple of employee details. <?php $json1 = '{"id": "GD01", "name": "Garrett Davidson", "position...

Best Desktops for Programming & Developers 2020 - Buyer's Guide & Reviews

صورة
Slow computer sucks! Whether you are a newbie developer or a veteran programmer, you already know the necessity of a powerful computer in your profession. Though laptops are portable and easy to carry on your back, nothing can beat up the productivity of a desktop pc . Setting up a perfect workstation at home or office will bring in more discipline to your work. I agree desktop computers are stationary and take up lot of space but it happens to be more ergonomic than a crammed up laptop. There is no single best computer suitable for all developers. It just boils down to your programming requirements. The best specs and perfect hardware combination should be able to open up your coding opportunities. However choosing a perfect desktop for programming is not an easy job. You must know what sort of hardware combination is right for your coding demands. To make your job easier I'm going to show you how to pick up the best computer and what are the things to consider in a pro...

Best Monitors for Eyes (To Avoid Strain & Fatigue) 2020 - Buyer's Guide

صورة
Computers are inevitable these days. People look at screens all day regardless of work or game. However, when you continue to look at the monitor for hours it will lead to eye strain and fatigue. Especially professionals like computer programmers, web designers, video editors and bloggers are prone to eye problems due to long hours of working on computers. Therefore, it is important to choose eye-friendly monitors to keep your eyes healthy. Nowadays monitors are designed with eye care technology to help people with eye problems. Even if you are on tight budget, there are affordable monitors for eyes in the market. To maintain good eye-health you must be choosy with the monitor you use with your desktop pc or laptop. With a wide range of choices, it is definitely a tedious task to choose the best monitor for eyes. This buying guide gives you a good insight into eye care technology and helps you choose the right eye monitor in 2020. Top 10 Best Monitors for Eyes in 2019-2020...

Best Mechanical Keyboards for Programming in 2020 - Reviews & Buying Guide

صورة
As a coder you should never compromise on the quality of your tools and keyboard is one such important programming tool. Being a programmer you spend most of the time typing on the keyboard. Therefore, it only makes sense that you invest in the best mechanical keyboard for programming in 2020. A reliable high quality mechanical keyboard will provide you with comfortable typing experience and enhance your productivity. These mechanical keyboards use mechanical switches to give tactile feedback and help you type faster and efficiently than the standard keyboards. It is not an easy job to find the perfect keyboard to suit your need, so we put together the ultimate guide to help you in choosing the best coding keyboard. Best 6 Mechanical Keyboards for Programming - Recommendations & Reviews 1. Filco Ninja Majestouch 2 - Best Programming Keyboard Filco Ninja Majestouch-2 is the best mechanical keyboard for programmers on the market right now. It is one of the modern keyboards...

How to Get Country Name from IP Address with PHP

صورة
Hi! In this post, let's see how to get country name from ip address using php . When working on multilingual web applications, it is mandatory to find the geographic location of the visitors, so that you can provide the contents that match the specific location. Some websites even change country flags and themes accordingly. With PHP, you can get the visitor's IP easily, but unfortunately there's no way to get the country details from it. Hence, you have to rely on external web services to provide the location details. Here I'm going to show you how to find the country of visitors with the help of GeoPlugin API and PHP. Getting Country Name from IP Address with GeoPlugin: GeoPlugin is a free web service that provides geographical location of site visitors from IP. It offers various types of services like PHP, JSON etc., and in this tutorial, I'm going to use the JSON API to find the country name . You have to access the service with this url, http://ww...

How to Print Contents of a Div using JavaScript

صورة
Hi! Today let's see how to print contents of a div using javascript . Have you ever tried printing a web page or part of a page programmatically? There is an interesting utility in JavaScript called print(). It is one of the methods of the 'Window' object and is used to trigger your system's printing feature. In case you want to print part of a page area, the simple solution is to place all the printable content inside a 'div' block and invoke the print action with some user event. Let's see how to do it. Print Contents of a Div in JavaScript: Let's first create a div container to hold the printable part. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Print Part of a Webpage with JavaScript</title> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstr...

Codeigniter Login and Registration Tutorial & Source Code

صورة
Today we'll see a codeigniter tutorial demonstrating user login and registration system . As you know Login and Signup Module (User Management System) forms the base for membership driven websites and applications. I have written about codeingiter login and registration process separately earlier, but got requests from blog readers to provide a complete user management module. So in today's post, I have tried to cover as much as possible in user module comprising home, login, signup and user profile/dashboard page. So let us see how to create complete codeigniter login and registration system. Create Database for CI Login & Signup Module: First create the mysql database required for the codeigniter user management system. Read Also: CodeIgniter Two-Step Registration Form with Email Confirmation CodeIgniter Pagination Script with Search Filter using Bootstrap How to Retrieve Data From Database using CodeIgniter & AJAX CREATE DATABASE `testdb`; USE `testd...