Re: String to Stream

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jay Blanchard wrote:
[snip]
Jay Blanchard wrote:

If you place the string into a variable then you would be able to work
with it that way.


Using what functions?

Part of the point was not to need to keep track of the current location in the string, etc...basically things that streams tend to handle well.


There are probably better functions for dealing with a
string than the ones you have mentioned (fseek is a file pointer).


'like fscanf, fseek'
[/snip]

You have been a little vague about your desired usage but here is one
idea; Explode the string into an array and then use array functions to
navigate the string.
Here is a whole list of methods for handling strings....

http://us2.php.net/manual/en/ref.strings.php

Again, I would like to treat the string as a stream.

One possible way to accomplish this would be to simply write the string to a temporary file, open the file with fopen and then use fscanf, fseek, etc. to process the text.

However, I am assuming there is an easier way (i.e. a method without the file io overhead) to be able to treat the string as a stream.


--
== Eric Gorr =============================== http://www.ericgorr.net ===
"Therefore the considerations of the intelligent always include both
benefit and harm." - Sun Tzu
== Insults, like violence, are the last refuge of the incompetent... ===

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux