//get contanints from SimpleXMLElement Object
foreach($movies->channel->item as $opt){
$title= $opt->title;
$tittle=mysql_real_escape_string($title); //for Escapes special characters in a string you can use for all varriables if require
$link=$opt->link;
$des=$opt->description;
$image=$opt->medium_image_url;
//for store image from http url to my folder
$ch = curl_init($image);
$fp = fopen('images/'. time () .'.'.'jpg', 'wb');//path for store image
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
include('db.php');//config file for db connection
$sql="INSERT INTO rss (tittle, link, image,description,city)
VALUES ('$tittle', '$link', '$image','$des','$city')";//insert record in database table
$result=mysql_query($sql) or die('Error, insert query failed');
этот код хранит значение переменной в вашей базе данных и изображение в папке из http url.thanks ..