All pastes #985128 Raw Edit

Someone

public text v1 · immutable
·published 2008-04-14 20:20 UTC
rendered paste body
<?php


$source = file_get_contents('/var/www/html/index.php');
$tokens = token_get_all($source);

foreach ($tokens as $token) {
  // if (is_string($token)) {
       // simple 1-character token
       //echo $token;
  // } else {
       // token array
       list($id, $text) = $token;

       switch ($id) { 
           case  T_CONSTANT_ENCAPSED_STRING: 
           //case T_PRINT:            
	           echo $text;

               break;

           default:
               // anything else -> output "as is"
               //echo $text;
               break;
       }
   //}
}
?>