0

After more than 3 hours searching in google, I found that ppl do the other way around of what I am doing but anyway, here is what I want to do:

I have a variable $location which contains an HTML code (embedded google map code) i.e.

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0"  
        marginwidth="0" src="https://www.google.com/maps/ms?........in a larger 
        map></iframe>

now in a php code, how can i get the map to be displayed? the following outputs the HTML code as text

<?php echo $loation; ?>

Thanks!

3
  • 3
    You spelled your variable name wrong $loation; - should be $location;. Assuming you set your variable correctly like $location = '...';, you should be fine. Can you please post the code where you set the variable? Commented Aug 17, 2013 at 18:30
  • lol, you are right, it is $location, and thanks for the hint, it was defined as $info['location']; while it should have been html_entity_decode($info['location'], ENT_QUOTES, 'UTF-8'); Commented Aug 18, 2013 at 19:35
  • Posted my comment above as an answer so you can accept it. Thanks! Commented Aug 18, 2013 at 20:15

1 Answer 1

1

You spelled your variable name wrong $loation; - should be $location;. Assuming you set your variable correctly like

$location = '...';

OR using heredoc syntax:

$location = <<<STR
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0"  
        marginwidth="0" src="https://www.google.com/maps/ms?........in a larger 
        map></iframe>
STR;

you should be fine.

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

Comments

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.