Seen in functions where $a
is a function parameter:
if(!is_array($a))
$a=[$a]
I just don't know what this means,
Thanks!
It means;
if
$a
is not an array, then create$a
as anarray
and use the contents (value) of$a
as the first element of the newly created array called $a.
In readable English emulating a Code, this could mean:
<?php
if($a IS NOT AN ARRAY):
THEN CREATE A NEW VARIABLE $a OF TYPE: ARRAY.
TAKE WHATEVER IS INSIDE THE INITIAL $a VARIABLE...
AND PUT IT AS THE FIRST ELEMENT OF THE OVERRIDDEN, NEW $a VARIABLE.
endif;
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments