php - Tokenize string and know which part of delimiter grabbed -
I want to tokenize the functioning of PHP with a So here's an example: if I use now : I get If you're looking for a way to include the delimiter again because they have something The special syntax is - you should use syntax tools to not separate your delimiter because it is not intended for this function. Instead you can try to use it: - This will parse the syntax and dividing lexam into the resulting array (so that you will get your comments and your strings with array members, which are strtok () and it Want to know that the part of the delimiter caught the current token?
Some of my comments: one, two, three
$ token = strtok ($ string, '#:,'. PHP_EOL);
my comment as the first code because
# and
new line it was token Was there. So what is the probability of getting the starting and interval of the current token now?
$ string = '#my comment something: one, two three'; // Note that & lt ;? Php is required to parse the PHP syntax: $ result = token_get_all ('& lt ;? php'. $ String);
: , < code>, E TC).
Comments
Post a Comment