NachrichtWieBeiträgeAnteileSterneDiskutierenAntwortenLernprogramm

PHP 7 - Konstante Arrays

Array-Konstanten können jetzt mit dem definiert werden define()Funktion. In PHP 5.6 konnten sie nur mit definiert werdenconst Stichwort.

Beispiel

<?php
   //define a array using define function
   define('animals', [
      'dog',
      'cat',
      'bird'
   ]);
   print(animals[1]);
?>

Es erzeugt die folgende Browserausgabe -

cat
PHP 7 Tutorial
PHP 7 Tutorial
PHP 7 - Einführung
PHP 7 - Leistung
PHP 7 - Umgebung einrichten
PHP 7 - Skalartypdeklarationen
PHP 7 - Rückgabetypdeklarationen
PHP 7 - Null-Koaleszenz-Operator
PHP 7 - Raumschiffbetreiber
PHP 7 - Konstante Arrays
PHP 7 - Anonyme Klassen
PHP 7 - Closure :: call ()
PHP 7 - Gefiltertes unserialize ()
PHP 7 - IntlChar
PHP 7 - CSPRNG
PHP 7 - Erwartungen
PHP 7 - use Statement
PHP 7 - Fehlerbehandlung
PHP 7 - Integer Division
PHP 7 - Sitzungsoptionen
PHP 7 - Veraltete Funktionen
PHP 7 - Erweiterungen und SAPIs entfernt
PHP 7 Nützliche Ressourcen
PHP 7 - Kurzanleitung
ja/tutorial
es/tutorial
de/tutorial
fr/tutorial
th/tutorial
pt/tutorial
ru/tutorial
vi/tutorial
it/tutorial
ko/tutorial
tr/tutorial
id/tutorial
pl/tutorial
hi/tutorial
japost
espost
depost
frpost
thpost
ptpost
rupost
vipost
itpost
kopost
trpost
idpost
plpost
hipost

© Copyright 2021 - 2025 | All Rights Reserved