• 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

Phpunit partial mock + proxy Entity

PHPMyAdmin not working as intended at remote server. Error 500, $respond not found

How to insert data from multiple select dropdown values into database?

oauth-private.key does not exist or is not readable

PHP: Print caught exception like Xdebug

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

HTML + PHP + PHPMAILER

PHP sort array of objects by two properties

Exact alternate to mcrypt_encrypt in PHP 7.2

PHP: How to raise number to (tiny) fractional exponent?

Laravel relationship belongsToMany with composite primary keys

Insert multidimensional array to codeigniter cart

Cannot pass null argument when using type hinting

Display the WooCommerce product price inside a custom function

What's the net::ERR_HTTP2_PROTOCOL_ERROR about?

About Contact Privacy policy Terms and conditions