Array Format
Example 1:
<?php
return array(
'red' => 'rouge',
'blue' => 'bleu',
'green' => 'vert',
);
Example 2:
<?php
$colors = array(
//adding a comment to this red phrase
'red' => 'rouge',
'blue' => 'bleu',
'green' => 'vert',
);
Short Array Format (PHP >= 5.4)
<?php
return [
'red' => 'rouge',
//adding a comment to blue
'blue' => 'bleu',
/*adding a comment to green*/
'green' => 'vert',
];
Example 2:
<?php
$colors = [
'red' => 'rouge',
'blue' => 'bleu',
'green' => 'vert',
];
Plain Variables Format
Example 1:
<?php
$color = array();
$color['red'] = 'rouge';
$color['blue'] = 'bleu';
$color['green'] = 'vert';
Example 2:
<?php
$red = 'rouge';
$blue = 'bleu';
//$commented = 'commented string';
$green = 'vert';
*Note: OneSky platform currently does not support nested PHP arrays.
Comments
1 comment
That was so amazing.
Subarunet.com Login
Please sign in to leave a comment.