|
Posted by semi_evil on 05/26/07 19:43
I downloaded a few PHP scripts from various sites, in part to use them
as is, and partly to study and learn from them.
One script is littered with strtok() occurrences. So I checked the
manual for its details.
I do understand the basics of it, and the limitations (like not being
able to work on two strings simultaneously for loss of the strtok
internal 'pointer').
And it MUST be my ignorance and/or limited experience, but I don't
understand what this function has to offer that can't be solved with
str_split and explode functions, or to be more precise, what typical
problem can better/easier/faster be solved by using strtok() than by
the 'easier' string and array functions.
I am convinced there are good reasons to use strtok, maybe some folks
here can point me to a 'textbook situation' where strtok saves the day
or copy/paste a good self-explanatory example or link to additional
strtok() reading material.
Cheers!
Semi
Navigation:
[Reply to this message]
|