PHP

The special characters should be removed from the filename and URL to make it safe. When a web application creates a file and dynamic URL, it is convenient to use only characters and numbers to avoid portability issues. You can sanitize the string before assigning it for filename or URL slug. Use preg_replace() to clean up filename string to make URL safe in PHP.

By: CodexWorld Feb 25, 2022
PHP

Base URL is used to create internal web page links dynamically in the website. You can get the base URL from the full URL string using PHP. The parse_url() function helps to parse components from URL in PHP. The base URL can be retrieved from string using PHP parse_url() function. Use parse_url() function to get base URL from full URL string in PHP.

By: CodexWorld Feb 24, 2022
PHP

PHP array_filter() function is the best alternative to filter array by specific condition (key=value). You can use the array_filter() function to filter multidimensional array by date range using PHP. Use array_filter() and strtotime() function to filter multidimensional array by specific date in PHP.

By: CodexWorld Feb 26, 2022

Scroll to Div functionality is used to scroll the page to a specific element automatically. The page will navigate to a specific section of the page without scrolling manually. The scroll to HTML element feature can be integrated using JavaScript. Use scrollIntoView() method to scroll to an element in JavaScript.

By: CodexWorld Oct 4, 2023

Mostly, the value attribute of the option tag is used in the select box. Besides the option value, custom attributes can be defined in the option tag of the select dropdown. You can also get the custom attribute value from the select box with JavaScript. The attribute value of the selected option can be retrieved using JavaScript easily.

By: CodexWorld Jan 24, 2022

The UPDATE and SET commands help to update existing field values in MySQL. You can use these commands to add/subtract value to/from existing field value in a single query in MySQL. Use the GREATEST() method with the UPDATE and SET command to subtract the value from an existing field in MySQL but not a negative value.

By: CodexWorld Dec 9, 2021

Adding a row number column to the HTML table is very useful to make it user-friendly. If you are using React Bootstrap Table, the serial number column can be added easily. In this example code snippet, we will show you how to add a row number column to React Bootstrap Table in React.js. Use example code to display row numbers in React Bootstrap Table with pagination.

By: CodexWorld Nov 1, 2021

Ordinal number format helps to add st/nd/rd/th suffix to the calendar date. It is also a user-friendly way to represent a date on the web page. Mostly the ordinal suffix is added to the day of the month in a date string. We will create a custom JavaScript function to add st/nd/rd/th format based on the given number using JavaScript.

By: CodexWorld Sep 8, 2021
API

The Site and Secret Keys are required to use Google reCAPTCHA API on the website. Before getting started with Google reCAPTCHA, your website needs to be registered on the Google reCAPTCHA admin panel and generate API keys. Visit the Google reCAPTCHA Admin console and register the domain of your website.

By: CodexWorld Aug 25, 2021
keyboard_double_arrow_up