-3

I want to include a function inside an HTML that is showed as an echo in a php file, how can I achieve that? Thanks in advance.

Function: self::showMap($item);

The echo:

<?php
    echo "<html lang='en'>
    <head>
      <meta charset='utf-8' />
      <title>jQuery UI Tabs - Default functionality</title>
      <link rel='stylesheet' href='http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css' />
      <script src='http://code.jquery.com/jquery-1.9.1.js'></script>
      <script src='http://code.jquery.com/ui/1.10.3/jquery-ui.js'></script>
      <link rel='stylesheet' href=''/resources/demos/style.css' />
      <script>
      $(function() {
        $( '#tabs' ).tabs();
      });
      </script>
    </head>
    <body>

    <div id='tabs'>
      <ul>
      <li><a href='#tabs-1'>Tab 1</a></li>
        <li><a href='#tabs-2'>Tab 2</a></li>
        <li><a href='#tabs-3'>Tab 3</a></li>
      </ul>
      <div id='tabs-1'>
        <p>FUNCTION GOES HERE</p>
      </div>
      <div id='tabs-2'>
        <p>tab two content.</p>
      </div>
      <div id='tabs-3'>
        <p>tab three content.</p>
      </div>
    </div>

    </body>
    </html>";

?>
TIGER
  • 2,864
  • 5
  • 35
  • 45
Peter C.
  • 3
  • 1

1 Answers1

0

$function = self::showMap($item);

"Html $function Html......"; if you are using double codes in HTML, no need to concatenate, it'll appear as value.

Heartbeat
  • 142
  • 9