note 97907 deleted from book.simplexml by visualmind

From: Date: Sat, 15 May 2010 08:52:41 +0000
Subject: note 97907 deleted from book.simplexml by visualmind
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-169274@lists.php.net to get a copy of this message
Note Submitter: nogitsune101 ---- I don't know if there is another way or not, but I actually had a need to return a value from a simpleXMLElement, not just pass a referenced object and echo it out. After poking around a for a quick fix, I saw a few posts looking for the the same answer. function captureValue($value) { ob_start(); echo $value; $output = ob_get_contents(); ob_end_clean(); return $output; } Anyways, if anyone knows if/how to return simpleXMLElement's value as a variable, I'd much rather use it than the clunky solution above.

« previous php.notes (#169274) next »