Tárraga Tárraga - 1 year ago 132
PHP Question

PHP array_diff output

I am using array_diff correctly to compare 2 arrays.

In documentation, it says the output is like this:

[1] => blue

As you can see, each output will come in a single line.

But when I try it, it only shows me output in 1 line.

enter image description here

Maybe now can be a little friendly, because I only have 4 rows to compare, but I'm supposed to have, in the future, hundreds of them.

How could I solve this?

Answer Source

You can "pretty print" your array:

echo "<pre>";
echo "</pre>";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download