- token_get_all: documentation ( source)
- token_name: documentation ( source)
<?php
$code ='<?php
function test($a) {
echo $a;
}
$a = 10;
test($a);
?>';
$tokens = token_get_all($code);
foreach ($tokens as $row) {
echo token_name($row[0]), "\r\n";
}