Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

stdlib.php

Go to the documentation of this file.
00001 
00002 /** @file stdlib.php
00003 * Global functions.
00004 */
00005 /**
00006 * Convert location to filename.
00007 * @param name - location:
00008 *                       if starts with '/' it is absolute location
00009 *                       owerthise it is relative location and base path needs
00010 *                       to be added
00011 * @param path - base path
00012 */
00013 function location_to_filename( name, path )
00014 {
00015   if( path == '' )
00016     return name;
00017   if( name == '' )
00018     return path;
00019   if( name[ 0 ] != '/' )
00020     if( path[ strlen( path ) - 1 ] == '/' )
00021       return path.name;
00022     else
00023       return path.'/'.name;
00024   else
00025     return substr( name, 1 );
00026 }
00027 
00028 /**
00029 * Print debug information like print_r() but
00030 * format text by HTML tags.
00031 * param mixed data data to dump
00032 */
00033 function print_structure( data )
00034 {
00035   if( is_scalar( data ) )
00036   {
00037     echo "'data'";
00038   }
00039   if( is_array( data ) )
00040   {
00041     echo "Array<ul>";
00042     foreach( data as keyy => val )
00043     {
00044       echo "<li>'keyy' => ";
00045       print_structure( val );
00046     }
00047     echo "</ul>";
00048   }
00049 }
00050 
00051 X-Powered-By: PHP/4.0.8-dev
00052 Content-type: text/html
00053 
00054 

Generated on Tue Mar 11 08:35:13 2003 for SES by doxygen1.2.16