-1

I have done this little script.

<?php 
$url = "http://resurse.fibula.ro/parteneri/xmlhotels.php?location=belek&myid=travelplaza";
$xml = simplexml_load_file($url);
foreach($xml->hotel as $hotel)
{
echo "<p>";
echo "<strong>Title:</strong> ".$hotel->description."<br/>";
echo "</p>";

}

In the link above I've some images that I want to put under the description of each hotel. I have tried to get the images like i did with the description, like so:

echo .$hotel->images"<br/>";

But I get an error

" Parse error: syntax error, unexpected '.' in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\binaries\home\2.php on line 9"

Any help would be very much appreciated. An example or o resource where to read about it. For dummies I mean.

Thank you.

0

1 Answer 1

0

line 9 should look like this:

echo $hotel->images . "<br/>";

Having the . between the variable and the <br/> string. I encourage you to learn the basic PHP syntax.

Sign up to request clarification or add additional context in comments.

2 Comments

added this linne but now i get this result : Parse error: syntax error, unexpected '"<br/>"' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';' in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\binaries\home\2.php on line 9
Inseted the above echo ... but... it gives me no error, but there are no images showing. If you acces the link directly you can see the images url.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.