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!
I don't really know how to word this... I have a function that just dumps information to the browser. I remember reading something on php.net about a function that can take output and put it in a variable. I can't find it ANYWHERE now. anybody know what it is??
logerror("Could not post event: ".getdetails($_SESSION));
getdetails is a function that just dumps information about a variable onto the browser. How do I take that information and put it in a variable so I can save it into a log?
there is none, last I saw that does "exactly" what you wrote in your previous example. Besides, the code you posted would send the result (1) to the function in question... why not add some functionality to your getdetails() function that you can tell it to return the string or echo it, it shouldn't be that complicated..
Last edited by feyd on Wed Aug 17, 2005 6:21 pm, edited 1 time in total.
function getdetails($some_data)
{
$return_data = '';
if (is_array($some_data)
{
foreach($some_data as $data_value)
{
$return_data .= $data_value . '<br />';
}
}
return $return_data;
}
Is this what you are looking for? Using this you could easily write to the HTML the value of the information returned from what was passed to your function.