Many times we use checkbox in the form control and post the form using jquery ajax and then we are required to access those form data from client side scripts, like Javascript. Among all possible form control, dropdown box, checkbox and radio buttons are having multiple options to select. So, we need to push all selected values of these form controls into an array using Javascript

Read More

While working with array in PHP sometimes we need to check if a value exists in an array and delete that key and value together from array. This simple code snippet below with explanation will help you to understand how can you delete element by value from array (not by key).

Read More

Sometime we face a unique type of problem during development and we watch the code thoroughly but not find the error where we are getting. ‘Only variables should be passed by reference‘ in $file_extension = end(explode(‘.’, $file_name)) is the same type of problem which does not seem as error in our code and it happens in usual code.

Read More

JavaScript arrays are commonly used by developers and making them empty is also used in practice. Here I am describing 4 ways to empty an array in JavaScript:

1. Use splice() method
2. Set length to zero
3. Using pop() method
4. Set array to new empty array

Read More

Array in JavaScript has splice() method that changes the elements of an array, adding new elements as well as removing old.

splice() method for Array in JavaScript is powerful method that let you modify an existing array. You can add, remove elements or replace existing elements.

Read More

Array is most important keyword used in programming languages. Like other languages, Array is also used in javascript. Array in JavaScript is used to store multiple values in a single variable. Arrays in javascript is as special type of object

Read More

[ Page 2 of 3 ]