posted to this is not a weblog
on feb 12th, 2005

tagged nerd, php
and never commented on

share this page

i need a way to create a file handle in php and associate it with a string, instead of a file. that is, i have data in a string and i want to be able to use a bunch of already-defined functions that do fread()'s and such on the data, on the string.

i can't write the string to a temporary file or anything of that nature, it must remain in memory.

methinks i can write a custom stream wrapper to handle this and talk to the other functions with a filename of whatevermystreamis://blah which will in turn call my stream wrapper to do stuff from the string.

or maybe there's an easier way. but it's late and i'm tired and i can't concentrate right now.

leave the first comment or contact me

if you want to be able to mark your comment as authentic or delete it later, include your e-mail address (it won't be shown on the site). you'll be e-mailed instructions with a copy of your comment.

basic html allowed; be nice
required


optional, gravatar-ized


optional