• 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

Why is this PHP array not the same?

phparrays


PHP Snippet 1:

array( 'items[0][type]' => 'screenprint')

PHP Snippet 2:

$data = array('items' => array(0 => array('type' => 'screenprint')));

PHP Snippet 3:

$data = [
    'items' => [['type' => 'screenprint']]
];
echo $data['items'][0]['type'];

Related Snippets

Check if user online laravel

Download & Save Zoom Recording in directory by PHP

How to get page number on dompdf PDF when using "view"

Handling expired token in Laravel

Failed user login on production server using Symfony framework (Authentication request could not be processed due to...)

Filter array by skipping every nth element from the end

How can I get new CSRF token in LARAVEL by using ajax

Laravel 5.2: Unable to locate factory with name [default]

Fetch files from next cloud storage and display in Laravel website

Having trouble with PDO queries (Notice: Undefined index)

Match csv filenames to table names and import

PHP -> Next nearest date defined by array of days in week

Why rand() every time I refresh the page?

PHP usort() order in case of equality

Laravel UUID generation

About Contact Privacy policy Terms and conditions