- token_get_all: documentation ( source)
- token_name: documentation ( source)
<?php
$a = token_get_all("<?php $builder = new StdClass(); $builder->add('username', TextType::class, array('label' => 'form.username'))");
foreach ($a as $t) {
if (isset($t[1])) {
echo token_name($t[0]), "\n";
} else {
echo $t, "\n";
}
}