PHP try…catch Exceptions

PHP programming language provides try and catch statements in order to manage exceptions. The exceptin means an unexpected situation for an application that prevents the execution of the statements and interrupts the execution with errors. The try statement block is used to check any exception and the catch statement block is used to execute code if there is an error in … Read more

PHP cURL Tutorial

PHP cURL Tutorial

The cURL or Client for URLs is a popular tool and library used to download and upload files by using different protocols like FTP, HTTP, HTTPS, Telnet etc. PHP provides the cURL library libcurl natively as a built-in library. cURL Functions The PHP cURL library provides the following functions. Function Description curl_init() This function is … Read more

How To URL Redirect In PHP?

How To URL Redirect In PHP?

The HTTP protocol provides the redirection in order to redirect the request to another URL or webpage. The redirection is defined as an HTTP header. The PHP programming language provides the redirection with the header() function which adds the redirect HTTP header to the response. In this tutorial, we examine how to redirect with PHP … Read more

PHP Comment Tutorial

PHP Comment Tutorial

As a programming and scripting language PHP provides the comments in order to add description and notes to the code. This description is called a comment and not executed or interpreted by PHP. PHP comments can be used to explain the function, variable, code block, etc. Single-Line Comment with Hash Sign Similar to the other … Read more

How To Connect phpMyAdmin via “http://localhost/phpmyadmin”?

How To Connect phpMyAdmin via "http://localhost/phpmyadmin"?

The phpMyAdmin is free software written in PHP in order to manage the MySQL and MariaDB via Web interface or web page. By default, the phpMyAdmin is served via the URL “http://localhost/phpmyadmin” but in some cases, this may not work properly. In this tutorial, we list different ways to open and start a phpMyAdmin web … Read more

Display PHP Version

Display PHP Version

PHP provides different versions with different features. The latest PHP version is 7.4 as writing this post. Different versions of the PHP deployed in different platforms. The phpversion() function can be used to print currently running PHP version. phpversion() Function Syntax The phpversion() function syntax is like below. The EXTENSION parameter is optional and if … Read more

PHP str_replace() Function Tutorial

PHP str_replace() Function Tutorial

PHP provides the str_replace() function in order to replace characters or strings in a string. The str_replace() function can be also used to search in an array and replace string too. The replacement of the string occurs in every array element. The str_replace() function is case sensitive function where the uppercase and lowercase characters or … Read more