Good day folks!
I am just getting start in PHP and really could use some help.
I am trying to export an array into a XML file.
Some Background:
I currently working with a PHP class (Media Grabber) that grabs images from a URL, sorta like facebook & google.I am having issues posting that data after it has been captured.
Here is the process flow
[ul][li]User Enters URL
$imageMediaGrabber will do the heavy lifting
Grab array of images
Export to images.XML[/li]
[li][/li][/ul]
I am stuck after $imageMediaGrabber has the array. Please advise as to how I can export to XML. Please take a look below and let me know what you think. The code in question is 2 or 3 lines from the closing php tag. A million thanks!
[php]<?php
include ‘tut/connect.php’;
require_once dirname(FILE)."/bin/wlWmg.php";
require_once dirname(FILE)."/demo-utils.php";
$url = wlWmgUtils::getArrayValue($_POST, ‘user_url’, wlWmgUtils::getArrayValue($_GET, ‘user_url’, null));
?>
Thank you
Your information has been entered into our database
"'; } else { echo "ERROR: ".mysql_error(); } } else { ?>URL
<?php } ?> <?php if(!$image_extensions_active) { $image_extensions = null; } //the magic starts here ... //creating the image grabber object by giving some necessary parameters: //$url: url, //$image_extensions: the image extensions to grab (null means all) $imageMediaGrabber = new wlWmgImageGrabber($url, $image_extensions); //set download switch: if the images should be downloaded to localhost $imageMediaGrabber->setDoDownload($download); //limit filter: setting the media limit count to be grabbed if($limit_active) { $imageMediaGrabber->setLimit($limit); } //the processor will grab only the media founded inside the contents of the tag specified here if($tagslice_active) { $imageMediaGrabber->setGrabOnlyFromTagSlice($tagslice); } //grabbing if($url) { $imageMediaGrabber->grab(); //HOW DO I GET THIS EXPORTED TO XML echo '
'.print_r($imageMediaGrabber->getValidMediaNames(true), true).''; } ?>[/php]