Jump to content

Proper parsing of HTML in a custom PHP block


Dunkstormen

Recommended Posts

Hi IC Community,

I've recently made a PHP script to query my gameservers for their current status using the built-in blocks feature in IP.Pages.

However all the HTML I'm using is outputted using echo statements. Is it possible in any way to parse it like normal HTML code, instead of having multiple echo statements?

Link to comment
Share on other sites

I'm not sure I'm clear on what you are after. Can you show us the code you're using (feel free to change any details for privacy, etc.) and what you are hoping to change it to as an example?

If you're using a raw PHP block, then yes generally you just echo/print the output. You can use the heredoc syntax if you want to piece components together.

echo <<<EOF
           {$variable1}<br><i>some html</i>{$variable2}
EOF;

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...