samedi 20 août 2016

Why does the "echo" statement support outputting multiple arguments in a single line and the "echo" function does not?

In PHP you can output multiple arguments at once with the echo statement like this:

echo "Mangoes", " ", "are", " ", "tasty.";

When you try to do the same with the echo function like this:

echo("Mangoes", " ", "are", " ", "tasty.");

You will get a error, why is this so?
Could this be because PHP wants you to use string concatenation instead of multiple arguments?

Thank you in advance.

Aucun commentaire:

Enregistrer un commentaire