This is quite a simple question, but I am finding it hard to find an answer.
I have a script that has the following:
(array) $item->classes
I have seen array()
but never (array)
. What does it do?
This is quite a simple question, but I am finding it hard to find an answer.
I have a script that has the following:
(array) $item->classes
I have seen array()
but never (array)
. What does it do?
This is called typecasting. You can read more about on the PHP documentation. (array)
is used to convert scalar
or object
to array
see Converting to array