Created
June 4, 2011 21:22
-
-
Save BraveSirRobin/1008378 to your computer and use it in GitHub Desktop.
Simple demo of token_get_all()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$php = "<html><head><?php include '/foo/bar/php'; ?></head>...."; | |
foreach (token_get_all($php) as $tok) { | |
if (is_array($tok)) { | |
printf("token type %s: %s\n", token_name($tok[0]), $tok[1]); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment