Var_Dump
[ class tree: Var_Dump ] [ index: Var_Dump ] [ all elements ]

Source for file example-5.php

Documentation is available at example-5.php

  1. <html>
  2. <style>
  3.     /* style for XHTML_Text */
  4.     pre.var_dump            { line-height:1.8em; }
  5.     pre.var_dump span.type  { color:#006600; background:transparent; }
  6.     pre.var_dump span.value { padding:2px; color:#339900; background:#F0F0F0; border: 1px dashed #CCCCCC; }
  7. </style>
  8. <body>
  9. <?php
  10.  
  11. include_once 'Var_Dump.php';
  12.  
  13. echo '<h1>example5.php : Text displaying modes</h1>';
  14.  
  15. /*
  16.  * example5.php : Text displaying modes
  17.  *
  18.  */
  19.  
  20. $fileHandler tmpfile();
  21. $linkedArray = array(0 => 'John'11 => 'Jack'127 => 'Bill');
  22. $array = array(
  23.     'key-1' => 'The quick brown fox jumped over the lazy dog',
  24.     'key-2' => array(
  25.         'long-key' => $linkedArray,
  26.         'file' => $fileHandler
  27.     ),
  28.     'long-key-3' => 234,
  29. );
  30.  
  31. echo '<h2>Compact mode (offset 4)</h2>';
  32. Var_Dump::displayInit(
  33.     array(
  34.         'display_mode' => 'HTML4_Text'
  35.     ),
  36.     array(
  37.         'mode' => 'compact',
  38.         'offset' => 4
  39.     )
  40. );
  41. Var_Dump::display($array);
  42.  
  43. echo '<h2>Normal mode (offset 4)</h2>';
  44. Var_Dump::displayInit(
  45.     array(
  46.         'display_mode' => 'HTML4_Text'
  47.     ),
  48.     array(
  49.         'mode' => 'normal',
  50.         'offset' => 4
  51.     )
  52. );
  53. Var_Dump::display($array);
  54.  
  55. echo '<h2>Wide mode (offset 4)</h2>';
  56. Var_Dump::displayInit(
  57.     array(
  58.         'display_mode' => 'HTML4_Text'
  59.     ),
  60.     array(
  61.         'mode' => 'wide',
  62.         'offset' => 4
  63.     )
  64. );
  65. Var_Dump::display($array);
  66.  
  67. fclose($fileHandler);
  68.  
  69. ?>
  70. </body>
  71. </html>

Documentation generated on Mon, 11 Mar 2019 14:23:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.