time bomb

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

there are printf()s in there. Just use output control to capture all the output from that and return that. That's the easiest way.

look into these:

ob_start()
ob_get_clean()
ziggy1621
Forum Commoner
Posts: 37
Joined: Mon Sep 12, 2005 5:12 pm

Post by ziggy1621 »

The Ninja Space Goat wrote:there are printf()s in there. Just use output control to capture all the output from that and return that. That's the easiest way.

look into these:

ob_start()
ob_get_clean()
okay bro, i really appreciate the help. Here is where I'm at. I got ob_start to submit the info, but i can't get both ob_start and substr to work at the same time.

Code: Select all

function callback($buffer)
{

  return substr($buffer,96,100); 
}

ob_start("callback");


render_news('http://www.surfline.com/rss/region.cfm?alias=cocoabeachcam', false, news, news2,1); 


$report = ob_get_contents();
ob_end_flush();
this works in that it sends the output of render_news, but its not working on substr

thanks
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Code: Select all

ob_start();
render_news('http://www.surfline.com/rss/region.cfm?alias=cocoabeachcam', false, news, news2,1);
$report = substr(ob_get_clean(),96,100);

// Now write $report to a file
ziggy1621
Forum Commoner
Posts: 37
Joined: Mon Sep 12, 2005 5:12 pm

Post by ziggy1621 »

that gives me the result "1" thats all that appears in the text file

EDIT: YOUR EDIT WAS THE TRICK>>> WOOOHOOO.. thanks a ton!
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

:D
Post Reply