• 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

Performance of foreach, array_map with lambda and array_map with static function

dompdf and img tag, image wont show

PHP array stringify

Redirect to previous page with php

Multiple order by in WooCommerce

how to upload binary image to sql server using php laravel

how to make my own auto increment in php?

Json_Encode not returning html even i try to encode JSON_HEX_QUOT | JSON_HEX_TAG

PHP Array split string and Integers

Get WooCommerce products from specific category

PHP using str_starts_with for array to exclude same as with wildcard

generate an Excel file using PHP

Laravel Factory not calling callback 'afterCreating'

TesseractOCR not working for Laravel

How to make a array inside array?

About Contact Privacy policy Terms and conditions