Convert Array to XML and XML to Array in PHP


convert-array-to-xml-parse-read-file-php-codexworld

XML is used in many ways in the web application. If you're concerned about database size and want to reduce database uses, XML can help you to free the space from the database. Instead of the database you can store the data in the XML file and retrieve data from XML file without connecting to the database. This tutorial shows how to convert PHP associative or multidimensional array to XML and stored in the XML file.

Read Full →

Stripe Payment Gateway Integration in PHP


stripe-payment-gateway-integration-php-api-codexworld

Stripe payment gateway makes it easy to integrate checkout system and collect payment on the website. The Stripe API is a powerful solution to integrate checkout system in the web application to provide a smooth payment experience. If you want to accept credit card payment on your website, Stripe will the best option for that. You can easily integrate checkout system in your PHP-based website.

Read Full →

How to Get Latitude and Longitude from Image in PHP


get-latitude-longitude-from-image-php-google-map-api-codexworld

Geographical location can be tagged with the photograph by geotagging. Generally, the latitude and longitude are assigned to the image to geotagged photograph. Geotagging is done by two ways, automatic or manual. There is an easy way to get Geotag data from the image using PHP. You can get the latitude and longitude where the picture was taken using PHP and mark the geolocation on Google map.

Read Full →

Pagination in PHP with MySQL


php-pagination-class-mysql-codexworld

Pagination is a common functionality used almost every web application. When the huge data need to be retrieved from the database, it's not a good idea to display all result on one page. In that case, we can divide the records into pages instead of showing all at once. PHP Pagination class allows to paging data into pages and generates links to get data from MySQL database.

Read Full →

PHP CRUD Operations with MySQLi Extension


simple-php-crud-operations-mysql-tutorial-codexworld

CRUD stands for Create, Read, Update and Delete. CRUD operations are commonly used to manipulate data in the database. Almost, all web application used Add, Edit, Update and Delete functionality for managing data. This tutorial will show how you can create a simple PHP CRUD application with MySQL to perform create (insert), read (select), update, and delete operations using MySQLi Extension and OOP.

Read Full →

Send Email with Attachment in PHP


php-send-html-email-with-attachment-codexworld

Sending email from the script is the very useful functionality in the web application. If your web application uses PHP, it's very easy to send email from the script using PHP. PHP provides an easy way to send email from the website. Using mail() function in PHP, you can send text or HTML email. But sometimes email functionality needs to be extended for sending an attachment with the email from PHP script.

Read Full →

How to Export Data to CSV File using PHP and MySQL


export-table-data-to-csv-file-php-mysql-codexworld

CSV (comma-separated values) is the most popular file format to store tabular data in plain text. Generally, CSV file is used to import and export data for moving tabular data between programs. Import and export data is the most used feature in the web application, and CSV file format is a best chose for that. Here you will learn to create CSV file in PHP and download and save MySQL data in CSV file using PHP.

Read Full →

How to POST and Receive JSON Data using PHP cURL


post-get-receive-json-data-php-curl-codexworld

When you working with web services and APIs, sending JSON data via POST request is the most required functionality. PHP cURL makes it easy to POST JSON data to URL. This tutorial shows you how to POST JSON data using PHP cURL and get JSON data in PHP. Our example code makes an HTTP POST request and send the JSON data to URL with cURL in PHP. Also, you can get or fetch the JSON POST data using PHP.

Read Full →

How to Capture Screenshot of Website from URL using PHP


capture-screenshot-website-url-using-google-page-speed-insights-api-php-codexworld

Web page screenshot capture functionality is used for various purposes in the web application. There are many third party APIs are available to take a screenshot of the website. But if you wish to build your own script to get a screenshot from URL, you can do it easily using PHP and Google PageSpeed Insights API. Google PageSpeed Insights API can be used to get a screenshot of the website from URL.

Read Full →