DEV Community

Discussion on: Create an array and access array elements in PHP

Collapse
 
jmau111 profile image
jmau111⚡⚡⚡ • Edited

hello,
You can safely use the modern array syntax, so ['a','b','c',] instead or array('a','b','c').

Collapse
 
yanyy profile image
Yongyao Yan

thank you for your comment.
For backward compatibility, array() syntax can be used.

Collapse
 
jmau111 profile image
jmau111⚡⚡⚡

Backward before PHP 5.4?