SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: Name That Function!
-
Apr 30, 2005, 15:30 #1
- Join Date
- Apr 2003
- Location
- PA
- Posts
- 518
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Name That Function!
I don't remember the name of this function (or functions).
All I know is what it does: You call this function and whatever is echo()ed is assigned to a variable. Then you call the same function or possibly another function again once you're done collecting data.
Sound familiar to anyone? I'm asking because I want to be able to cache the output of some eval()ed code.
-
Apr 30, 2005, 15:31 #2
- Join Date
- Aug 2003
- Location
- Manchester, UK
- Posts
- 4,007
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
PHP Code:ob_start();
echo 'hello';
$foo = ob_get_contents();
ob_end_clean();
echo $foo; //outputs hello
-
Apr 30, 2005, 15:32 #3
- Join Date
- Apr 2005
- Posts
- 81
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
http://uk2.php.net/manual/en/function.ob-start.php
{Edit: Damn, too slow}
-
Apr 30, 2005, 15:34 #4
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
ob_start/ob_get_contents
Edit: Gah. I had it typed at 6:29, hit submit... and it didn't submit. Just checked back on the tab and had to resubmit.- Nathan
-
Apr 30, 2005, 16:00 #5
- Join Date
- Apr 2003
- Location
- PA
- Posts
- 518
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thats it! Thanks a million, everyone.
Bookmarks