• 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

PHP array, move keys and values to new array, but mix it up

Issue saving card for customer

Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

PHP random string generator

str_word_count() function doesn't display Arabic language properly

PHP Download MP3 files from directory on server

Limit login attempts in Laravel 5.7

Check if my GET request has Header: Token

Get orders by date and status woocommerce

Extract house numbers from address string

Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: ) in Unknown on line 0

Add custom text under order details on WooCommerce My account view order pages

PHPUnit 7: Failed asserting that exception of type InvalidArgumentException is thrown

protect my blog content

Pagekite error: FAIL: localhost:8080 is down

About Contact Privacy policy Terms and conditions