How to add or remove value from javascript array

JavaScript arrays are used to store multiple values in a single variable. An array is a special variable, which can hold more than one value at a time. Using an array literal is the easiest way to create a JavaScript Array. var array_name = [item1, item2, …]; JavaScript arrays allow you to group values and iterate over them.… Read More »

how to block requests with specific string using .htaccess in apache

These days common problem of hacking of website by hacker with scrips. They always use some common method or string to hack it. Now you can prevent these requests by adding some simple .htaccess rules. You could send a 403 Forbidden (access denied) in case -admin is requested : RewriteEngine On RewriteCond %{REQUEST_URI} ^/(.*?)admin RewriteRule ^(.*)$ – [F,L]  … Read More »

PHP how to sort array with user defined keys

Many times, we need to do sort array with some user defined keys. So we can use pre defined php function to make it easier.  We can array_flip function to achieve it, array_flip — Exchanges all keys with their associated values in an array.  array_flip() returns an array in flip order, i.e. keys from array become values and values from array become keys. Note… Read More »

Filter for unique values or remove duplicate values from Excel OR CSV

In Excel, there are several ways to filter for unique values—or remove duplicate values: To filter for unique values, click Data > Sort & Filter > Advanced. To remove duplicate values, click Data > Data Tools > Remove Duplicates. To highlight unique or duplicate values, use the Conditional Formatting command in the Style group on the Home tab.

Magento 1.9.4.1 Invalid header line detected error

HTTP headers are the name or value pairs that are displayed in the request and response messages of message headers for Hypertext Transfer Protocol (HTTP). Usually, the header name and the value are separated by a single colon. HTTP headers are an integral part of HTTP requests and responses. In simpler terms, HTTP headers are… Read More »

How to redirect non www or non https url to www and https

This is very common problem to everyone to redirect non www urls to www with https. You can follow simple .htaccess rules to implement it. RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301] The only real difference here is that first we redirect from non-WWW to… Read More »