PHP
Array

Many Helpful Function are available to exact the specific set of keys of an array

$sliced-arr = array_slice($new_tags, 0, 6);

The above code slice the array form keys 0 to 6, So you have 6 entries in the New array.

You can use it according to the need.Further you can used following links to see more examples

Add new comment

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Other Articles

Print array or object in watchdog drupal 7

hey, For many purpose we have to print the array or object while making a custom modules or debuging any old module, we have to print the array or object to see the values are fine or not, drupal p

Fix Bug Phpmyadmin [sql.lib.php] + Php7.2 + Ubuntu 16.04

I have faced this error recently , look like this    Warning in ./libraries/sql.lib.php#601

Render menu on page template in custom way Drupal 8

If you want to render the menu items in custom way in page or node twig template of drupal 8 then this article is for you :  

Drupal Country code default array

include_once DRUPAL_ROOT . '/includes/locale.inc'; country_get_list();  

Drupal 7 Multisite setup

Here is some links will helps to create a multisite of drupal 7 

Play Pause HTML5 Video using Jquery

HTML5 video playing on any web page is very easy, in this tutorial we can show you how to add video on html and make it play and pause without using html controls.

send Variable to Js File From PHP in drupal Custom Module

If we need to use the php variable in our js file we can use Core Drupal.settings Functionality :  example:

Import Database using xampp mysql command prompt windows

As we all know the xampp is most popular tool at machine level programming work, but sometime we need to deal with the bigger databases to import into mysql of xampp that provide and we import that

How to get your MailChimp LIST ID

Mailchimp is marketing automation platform and is provide email for marketing your product or business whatever you like, today its most trusted service providing all over the globe.

Import and Export Drupal 8 Views, Or Import and Export any configuration Drupal 8

Import and Export configuration is the basic protocol to staging the website or production website deployment, In Drupal 7, we need the extra modules to import and export or we can use features mod

Convert a certificate into the cer,crt,der,pem format

For different reason we need the different format of certificates for different operating system, many of sites offering you to convert the certificates in different format online but if you have b

Check the size of folder, files and directories using SSH

Following commands(In Bold) used for different purpose  1. Use df -h For check out the used space, free space and total space From all the partitions.

Getting permission error when installing CiviCRM under Drupal with Xampp

If you are getting permission error while installing CiviCRM on xampp then, its is default CiviCRM user permission error,

How to override different version of Jquery in Drupal 8 using theme

Drupal 8 use its own jquery version by default and if you want to use the other version of jQuery instead of default than this tutorials steps is for you, sometimes we need different version to oth

Get average number with PHP

<?php //put all integer in array $array = array(9,18,9,5,6,45); //Calculate the average. $average = array_sum($array) / count($array);

what is namespace in PHP?

https://stackoverflow.com/questions/3384204/what-are-namespaces

Render block and views block drupal 7 programmatically

This is article is for Drupal 7 to render block in templates and custom blocks using php codes Actually there is very simple ways to render block pro-grammatically 

Drupal site maintenance not affecting front page

function HOOK_preprocess_page(&$vars) { global $user;

Schema API Drupal not accept the datatype like date or datetime

Schema  Api Drupal 7 and Drupal 8 not accept the datatypes Like data or datatime and generate the warning and sql syntax error while installing the drupal module in install  normally we

Render a drupal node d7

If you want to render a node in drupal 7 it is pretty easy, you just a node id or nid of node for doing this: simply

How to Manually Disable a WordPress Plugin

 Manually Disable a WordPress Plugin in Just 4 Steps :

Wordpress Revolution Slider error after upgrade to php 7

A recently got the error below after updating wordpress website to php 7, error causing the website blank and when the debug mode on we got this error, caused by revolution slider.

How To Install Webmin on Ubuntu 18.04

Webmin is open source control panel for linux machine, it is mainly use for server as file transfer, email configuration and other servers configuration using modern user interface.

List of Most of File Type extension for drupal File field

List of Most of File Type extension for drupal File field : 

Recent Posts

Create a Flag link programmatically and render flag link in twig template drupal 8

This article is refer to generate the flag link programmatically and render in drupal 8 twig template, before in drupal 7 its was quiet easy to render or generate flag link in just a single line of

Jquery prevent enter to submit form

If you want to prevent the form submit using jquery, then this page helps you to doing this.

Code:

Play Pause HTML5 Video using Jquery

HTML5 video playing on any web page is very easy, in this tutorial we can show you how to add video on html and make it play and pause without using html controls.

Import and Export Drupal 8 Views, Or Import and Export any configuration Drupal 8

Import and Export configuration is the basic protocol to staging the website or production website deployment, In Drupal 7, we need the extra modules to import and export or we can use features mod

How to override different version of Jquery in Drupal 8 using theme

Drupal 8 use its own jquery version by default and if you want to use the other version of jQuery instead of default than this tutorials steps is for you, sometimes we need different version to oth

Subscribe to Mailchimp programmatically via api with PHP

In this tutorial we can see how to subscribe to the mailchimp subscribe list using php programmatically via api,

For this you need a mailchimp account, api key and list id 

How you can get Mailchimp API KEY

By Follow steps below, you can find the api key or create the api key at mailchimp and use it to your website to connected the site with mailchimp to collect the subscribe in fastest way.

How to get your MailChimp LIST ID

Mailchimp is marketing automation platform and is provide email for marketing your product or business whatever you like, today its most trusted service providing all over the globe.

Drupal 8 add custom menu classes to using menu.html.twig

In Drupal 8 Twig templates give extra power to drupal to add dynamic content in twig style, In this tutorial we can see how we can add the custom menu classes to menu ul li using menu.html.twig.

How to create the directories and sub directories in one command linux

Many times we are want to create multiple directories and sub-directories under it and usually we do cd and mkdir one by one, it is very time consuming and it sometimes slow down our workflow.

Create Node drupal 8 programmatically with image upload using custom module

As we know drupal 8 use symphony, so module structure of drupal 8 is change and workflow functionality of doing thing also change.