PHP

Subtract time (hours, minutes, and seconds) from date can be easily done using date() and strtotime() function in PHP. You can use date() and strtotime() functions together to subtract hours or minutes or seconds form the current DateTime using PHP.

By: CodexWorld Sep 16, 2020

Mostly, the confirmation popup is shown before processing the delete request. You can easily display a confirmation dialog using Window confirm() method in the client-side. You can also use confirm() method to show confirm box on anchor link click with onclick() event.

By: CodexWorld Nov 5, 2018

The SHOW COLUMNS syntax shows the information about columns in a specified table. The INFORMATION_SCHEMA is the best way to get the columns of a table in MySQL. If you want to get the table columns from the PHP script, use INFORMATION_SCHEMA to select column names from a table in MySQL.

By: CodexWorld Oct 8, 2018

By default, the selected checkboxes value is posted on form submission to the server-side. But if you want to get the selected checkboxes values without form submission, jQuery is the best option. The selected checkboxes value can be get easily using jQuery.

By: CodexWorld Sep 20, 2018
PHP

The preg_replace() function performs a search with the regular expression and replaces the matches with specified replacement. Use preg_replace() function to remove special characters from string in PHP. Removes the special characters from string except space with regular expression using PHP.

By: CodexWorld Sep 13, 2018
PHP

The string comparison can be easily done by the PHP built-in function called strpos(). The strpos() function in PHP, is the easiest way to check if a string contains a specific word or substring. Use strpos() function to check whether a specific word exists in the given string.

By: CodexWorld Aug 26, 2022
PHP

Human readable file size makes easier to read the file size and converts a number of bytes in the largest unit. To display file size in human readable format, you need to convert it to KB, MB, GB, TB, etc. Generally, the file size is stored in bytes which can be easily converted to kilobyte, megabyte, gigabyte, etc format.

By: CodexWorld Aug 28, 2018
PHP

The website availability status can be checked from the PHP script and notify about the downtime if the website is down. The cURL is the easiest option to check website availability with PHP. If you want to check the website’s server status, perform a cURL request to check if the website is available or online.

By: CodexWorld Aug 6, 2018
PHP

The array_map() and array_filter() function can helps to filter empty elements recursively from multidimensional using PHP. Use the array_map() function with array_filter callback to filter each array in multidimensional array.

By: CodexWorld Oct 2, 2023
keyboard_double_arrow_up