- token_get_all: documentation ( source)
- htmlentities: documentation ( source)
- token_name: documentation ( source)
<?php
$code = '<?php echo 0x00+2;';
foreach(token_get_all($code) as $c){
if(is_array($c)){
print(token_name($c[0]).": '".htmlentities($c[1])."'\n");
}
else {
print("$c\n");
}
}