• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

I want to store data in new index as per my key in php [duplicate]

phparrays


PHP Snippet 1:

$pieces = array_chunk($my_array, 6);

PHP Snippet 2:

<?php
$a = ["a","a","a","a","a","a","a","a"];

$b = array_chunk($a, 7);

echo"<pre>";print_r($b);

?>

PHP Snippet 3:

Array
(
    [0] => Array
        (
            [0] => a
            [1] => a
            [2] => a
            [3] => a
            [4] => a
            [5] => a
            [6] => a
        )

    [1] => Array
        (
            [0] => a
        )

)

Related Snippets

I'm trying to use curl with php but getting this error:Could not resolve host: Bearer

How to reset Laravel AuthManager/guards in between API calls in tests?

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

How to auto populate preferredCountries from intl-tel-input with db output

PHP password_verify

PHP: set a (deep) array key from an array [closed]

How to add a heading in between checkout fields of WooCommerce

PHP and WebView - Cookie doesn't are the same

How can I access an array/object?

Woocommerce Edit Message "An account is already registered with your email address. Please log in."

How to break out of a foreach once a condition is met?

how to youtube api data to print in toolset metabox using a button click before save-post

Add and update products to session cart in Laravel

Laravel dosen't connect with Oracle

Symfony autowiring issues since docker update

About Contact Privacy policy Terms and conditions