“PHP Inicialize a matriz” Respostas de código

PHP Inicialize a matriz

// Initialize Empty Array (PHP 5.4 and higher)
$myArray = [];

// Initialize Empty Array (Before PHP 5.4)
$myArray = array();
Web Surfer

PHP Definir Array First 10 Número


<?php
// array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
foreach (range(0, 12) as $number) {
    echo $number;
}

// The step parameter
// array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
foreach (range(0, 100, 10) as $number) {
    echo $number;
}

// Usage of character sequences
// array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i');
foreach (range('a', 'i') as $letter) {
    echo $letter;
}
// array('c', 'b', 'a');
foreach (range('c', 'a') as $letter) {
    echo $letter;
}
?>

Alberto Peripolli

PHP não -emitem a matriz

$data = serialize(array("Red", "Green", "Blue"));
echo $data . "<br>";

$test = unserialize($data);
akyagmur

Respostas semelhantes a “PHP Inicialize a matriz”

Perguntas semelhantes a “PHP Inicialize a matriz”

Mais respostas relacionadas para “PHP Inicialize a matriz” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código