Answers for "string array php"

PHP
4

php array

<?php
$array = array(
    "foo" => "bar",
    42    => 24,
    "multi" => array(
         "dimensional" => array(
             "array" => "foo"
         )
    )
);

var_dump($array["foo"]);
var_dump($array[42]);
var_dump($array["multi"]["dimensional"]["array"]);
?>
Posted by: Guest on June-17-2020
0

$array

// this is a covenient way to push or crate an array and push element to it, if null  
$arr = [1, 2, 3];
$arr[] = 4; // $arr = [1,2,3,4]
Posted by: Guest on January-01-1970
1

tab php

$tab = array(); // empty tab
$tab = array("0" => "Hello", "1" => "world"); // $tab[0]="hello" and $tab[1]="world"
Posted by: Guest on March-22-2020

Browse Popular Code Answers by Language