|
Posted by Benjamin on 12/04/06 03:38
Adam Scheinberg wrote:
> Hello all,
>
> This is my first post and I'm wondering if someone can point me in the
> right direction. I have seen the following code MANY times in programs
> and throughout the internet:
>
> <?php
> echo '<pre>';
> print_r($array);
> echo '</pre>';
> ?>
>
> As a result, I often create a function called print_r_pre() in my code
> to mimic this during development, which is highly useful in
> interpreting large arrays. It seems, though, that when using
> print_r(), mostly people would *usually* want this behavior (and not
> just in the source code).
>
> I would like to suggest to develpers one of three things:
>
> 1. Most desirable: the introduction of a new function, print_r_pre()
> which takes the same arguments as print_r().
> 2. Secondly: add a third argument to print_r(), which allows you to use
> print_r($array,0,1) or somesuch.
> or
> 3. The least desirable: change the default behavior of this function to
> spit <pre> tags
This sort of function might be nice for you but things like this are
really what user functions are for. If PHP kept adding new
"personalized" functions to the source, PHP would become really bloated
and bulky. If you really want that function, you could create your own
extension in C.
>
> My problem is, I'm not sure how to do this - do I do this on the
> internals mailing list? The general php list?
>
> Can anyone point me in the right direction?
>
> A
Navigation:
[Reply to this message]
|