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. <?php
  2. header('Content-Type: application/xhtml+xml; charset=utf-8');
  3. header('Vary: Accept')
  4. ?>
  5. <?xml version="1.0" encoding="UTF-8"?>
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  7.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  9. <head>
  10.     <title>An XHTML 1.0 Strict standard template</title>
  11.     <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  12.     <meta http-equiv="Content-Style-Type" content="text/css" />
  13.     <style>
  14.         /* style for XHTML_Text */
  15.         pre.var_dump            { line-height:1.8em; }
  16.         pre.var_dump span.type  { color:#006600; background:transparent; }
  17.         pre.var_dump span.value { padding:2px; color:#339900; background:#F0F0F0; border: 1px dashed #CCCCCC; }
  18.     </style>
  19. </head>
  20. <body>
  21.  
  22. <?php
  23.  
  24. include_once 'Var_Dump.php';
  25.  
  26. echo '<h1>example5.php : Text displaying modes</h1>';
  27.  
  28. /*
  29.  * example5.php : Text displaying modes
  30.  *
  31.  */
  32.  
  33. $fileHandler tmpfile();
  34. $linkedArray = array(0 => 'John'11 => 'Jack'127 => 'Bill');
  35. $array = array(
  36.     'key-1' => 'The quick brown fox jumped over the lazy dog',
  37.     'key-2' => array(
  38.         'long-key' => $linkedArray,
  39.         'file' => $fileHandler
  40.     ),
  41.     'long-key-3' => 234,
  42. );
  43.  
  44. echo '<h2>Compact mode (offset 4)</h2>';
  45. Var_Dump::displayInit(
  46.     array(
  47.         'display_mode' => 'HTML4_Text'
  48.     ),
  49.     array(
  50.         'mode' => 'compact',
  51.         'offset' => 4
  52.     )
  53. );
  54. Var_Dump::display($array);
  55.  
  56. echo '<h2>Normal mode (offset 4)</h2>';
  57. Var_Dump::displayInit(
  58.     array(
  59.         'display_mode' => 'HTML4_Text'
  60.     ),
  61.     array(
  62.         'mode' => 'normal',
  63.         'offset' => 4
  64.     )
  65. );
  66. Var_Dump::display($array);
  67.  
  68. echo '<h2>Wide mode (offset 4)</h2>';
  69. Var_Dump::displayInit(
  70.     array(
  71.         'display_mode' => 'HTML4_Text'
  72.     ),
  73.     array(
  74.         'mode' => 'wide',
  75.         'offset' => 4
  76.     )
  77. );
  78. Var_Dump::display($array);
  79.  
  80. fclose($fileHandler);
  81.  
  82. ?>
  83.  
  84. </body>
  85. </html>

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