Print Arrays nicely using pr

I recently had to do some debugging of arrays. Print_r() is very, very ugly:
Array ( [0] => struct SidAndAttributesType { string SecurityIdentifier; unsignedInt Attributes; } [1] => struct NonEmptyArrayOfGroupIdentifiersType { SidAndAttributesType GroupIdentifier; } [2] => struct
I did some research and found a nice solution: use pr() instead of print_r.
Array
(
    [0] => struct SidAndAttributesType {
 string SecurityIdentifier;
 unsignedInt Attributes;
}
    [1] => struct NonEmptyArrayOfGroupIdentifiersType {
 SidAndAttributesType GroupIdentifier;
}
    [2] => struct NonEmptyArrayOfRestrictedGroupIdentifiersType {
 SidAndAttributesType RestrictedGroupIdentifier;
}
Shorter, simpler, sweeter!
No votes yet

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.