Reply to Re: strtok() rationale

Your name:

Reply:


Posted by Andy Hassall on 05/26/07 21:27

On 26 May 2007 12:43:24 -0700, semi_evil@inbox.com wrote:

>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.

It's possible that the author of the code has experience writing string
manipulation code in C, and so was drawn to PHP's string functions that mirror
the standard ones from <string.h>, including strtok, which also inherits the C
function's limitations (most notably, no requirement for reentrancy).

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация