phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgwapi/inc php3_support_functions.inc.php,1.13


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc php3_support_functions.inc.php,1.13,1.14
Date: Mon, 18 Feb 2002 05:26:01 -0500

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv3790

Modified Files:
        php3_support_functions.inc.php 
Log Message:
Add printing of var type in print_r()



Index: php3_support_functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/php3_support_functions.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** php3_support_functions.inc.php      10 Feb 2002 12:28:24 -0000      1.13
--- php3_support_functions.inc.php      18 Feb 2002 10:25:57 -0000      1.14
***************
*** 272,291 ****
        }
  
!       function print_r($array)
        {
!               if(gettype($array)=="array")
                {
!                       echo '<ul>';
                        while(list($index, $subarray) = each($array) )
                        {
!                               echo '<li>'.$index.' <code>=&gt;</code>';
!                               print_r($subarray);
                                echo '</li>';
                        }
!                       echo '</ul>';
                }
                else
                {
!                       echo $array;
                }
        }
--- 272,300 ----
        }
  
!       function print_r($array,$recursed=False)
        {
!               if(is_array($array) || is_object($array))
                {
!                       if(!$recursed)
!                       {
!                               echo '<p>';
!                       }
!                       echo ucfirst(gettype($array)) . '(<ul>';
! 
                        while(list($index, $subarray) = each($array) )
                        {
!                               echo '<li>'.$index.' <code>=&gt;&nbsp;</code>';
!                               print_r($subarray,True);
                                echo '</li>';
                        }
!                       echo '</ul>)';
!               }
!               elseif(is_string($array))
!               {
!                       echo ucfirst(gettype($array)) . '("' . $array . '")';
                }
                else
                {
!                       echo gettype($array) . '(' . $array . ')';
                }
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]