var_dump(implode(',', array('11','22')));
And
var_dump(implode(array('11','22'), ','));
Which is right?
var_dump(implode(',', array('11','22')));
And
var_dump(implode(array('11','22'), ','));
Which is right?
According to the documentation on implode():
implode() can, for historical reasons, accept its parameters in either order. For consistency with explode(), however, it may be less confusing to use the documented order of arguments.
The documented description is:
string implode ( string $glue , array $pieces )
implode(',', array('11','22')) (the documented order) is identical to implode(array('11','22'), ',')). Both create the string 11,22.
Read this:
implode() can, for historical reasons, accept its parameters in either order. For consistency with explode(), however, it may be less confusing to use the documented order of arguments.
Taken from http://php.net/manual/en/function.implode.php
Both are accepted, but as it says above - documented order of arguments should be used.