PHP

Code optimization can reduce the execution time of the script. Using the looping statements, you can get an array of a specific key from the multidimensional array. But the same work can be done in a single line of code by array_column() function in PHP.

By: CodexWorld Jul 5, 2017

Before sending the file to the server for upload, it always a good idea to validate the file. Using JavaScript you can easily get the file info and validate in client-side. The following single line of javaScript code, help you to get the file name, size, type, and modified date.

By: CodexWorld Jun 30, 2017

PHP array can be used in JavaScript, whatever the array is a single or multidimensional or indexed or associative array. You can convert PHP array to JavaScript array easily with a single line of code. Using json_encode() function, PHP array can be converted to JavScript array and accessible in JavaScript.

By: CodexWorld Jun 23, 2017

You can access two types of value from select element. First one is the value to be sent to the server, which can easily get using the jQuery. The second one is the text value of the select element. Based on your requirement, single or both values can get from the select element.

By: CodexWorld Feb 26, 2020

JavaScript window.open() method opens URL in a new browser window. Use _blank in the second parameter of window.open() method to open a URL in a new tab using JavaScript.

By: CodexWorld Apr 15, 2023

Most of the cases the value of selected radio button gets after form submit. But if you want to get the value of selected radio button before form submits, with jQuery you can do it easily. The jQuery :checked selector helps to get the value of selected radio button.

By: CodexWorld Jun 1, 2017
PHP

PHP array_filter() function filters elements of an array by a callback function and it can be used for many purposes. The array_filter() function provides a short and simple way to filter multidimensional array by key and value. Use array_filter() to filter values from multidimensional array similar to SQL LIKE using array_filter() function in PHP.

By: CodexWorld Jan 4, 2023
PHP

By default, PHP allows uploading maximum 2 MB file on the server. But you can change the maximum size of file upload as per your requirement. Using the PHP configuration file (php.ini), you can increase or decrease the file upload size in PHP.

By: CodexWorld May 7, 2017
PHP

The php.ini file is a default configuration file that read on PHP starts up. The PHP settings and configuration can be modified by the php.ini file. If you want to change the PHP settings on Ubuntu, php.ini file is an easy and most effective way to do it. Follow the steps to modify the PHP configuration file (php.ini) using the command line on Ubuntu.

By: CodexWorld May 7, 2017
keyboard_double_arrow_up