As we can see in the docs:
Note that only the first call to strtok uses the string argument.
Every subsequent call to strtok only needs the token to use, as it
keeps track of where it is in the current string.
This function is meant to tokenize a string in a secuencial basis.
Whereas explode
returns an array with all the string split up, this function, in every call, returns the first token from the string, using the delimiter. In the next call, it returns the next token...but you can change the delimiter! so you can iterate over a string, and extract parts following a more complex logic, maybe evaluating the previous token, or obtaining the delimiter in runtime, etc
Of course you can write a parser, as well as you can do it with many of the other functions that you know, but this is only a very initial step, you would have to write all the logic by yourself (for instance, if you find a {
probably you can tokenize until }
but then you will have to recursively parse the returned string, and so on)