• 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

Not able to access model in the controller mautic

PHP7 CLI attempts to load xdebug twice - "Cannot load Xdebug - it was already loaded"

how to upload binary image to sql server using php laravel

Normalize DateInterval in PHP

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

How do I remove this delivery notification from here?

woocommerce change position of price

Chunk and transpose a flat array into rows with a specific number of columns

backup files to google drive using PHP

Cannot retrieve error message using Symfony HttpClient if the response is not "ok"

Ajax GET request fails in laravel 8

Wordpress how to get the post thumbnail inside a figure tag

How can i update or reset my password without entering email field in laravel-8?

Stop caching for PHP 5.5.3 in MAMP

Distribute array row data to make multiple new rows

About Contact Privacy policy Terms and conditions