You Are Viewing Posts Under Category: PHP Codes

How-To-Duplicate-Or-Copy-Paste-Entire-Row-In-MySQL-Same-Table-Using-PHP

How To Duplicate Or Copy/Paste Entire Row In MySQL Same Table Using PHP?

MySQL allows you to copy data across tables and databases, using SELECT and INSERT statements. In some cases, you may need to copy a row and insert into the same table in MySQL. This is often required to create test data for quality checks or duplication of data. In this article, we will learn how [...
How-To-Set-Value-Of-Unchecked-Checkbox-When-Submitting-To-PHP

How To Set Value Of Unchecked Checkbox When Submitting To PHP?

Checkboxes usually represent binary data that are stored in the database as Yes/No, Y/N, or 1/0 values. HTML checkboxes do have bad nature to sending value to the server only if the checkbox is checked! That means that server scripts on another site must know in advance what are all the possible che...

PHP REST API Calling General Function With Header And Body Response

I was recently working on a project where I needed to integrate an external API using HTTP cURL requests. It was my first time doing this and I had a lot of problems figuring this out. I wrote this post so I can remember my cURL API calls for next time, and maybe it can […]...
Complete-List-Of-Timezones-In-Dropdown-Using-PHP

Complete List Of Timezones In Dropdown Using PHP

If you’ve ever had to deal with time and PHP before, chances are you’ve had to deal with time zones. Dealing with time is difficult enough, but once the time becomes variable based on the preferences of the user of your application, it becomes even more confusing. Why so confusing? I mean, it se...
Pretty-Print-JSON-Data-Formatter-In-HTML-Using-PHP

Pretty Print JSON Data Formatter In HTML Using PHP

So many times we are required to print the JSON in a pretty format because it is easy to read and understood. As we know JSON (JavaScript object notation) is a lightweight data-interchange format. It is easy for humans to read and write. This tutorial shows how to pretty print JSON data in HTML usin...
How-To-Declare-and-Initialize-PHP-Objects-Without-Class

How To Declare and Initialize PHP Objects Without Class?

In this article, we go over how to initialize an object in PHP without Class. Initializing an object means that we give an object that has been created from a class a value or values. For example, say we create an object named car from the class of the vehicle. The vehicles class represents a [&hell...
Getting-Code-Executed-Inside-PRE-CODE-Tags-Even-They-Are-Properly-Escaped

Getting Code Executed Inside PRE/CODE Tags Even They Are Properly Escaped

Getting code executed inside pre/code tags even if they are properly escaped in WordPress blog or custom website then here is a quick fix for WordPress and custom websites. It’s time to fix this up to stop breaking your templates or blog pages until you find the main culprit because sometimes ...