0

I would like to easy to get converted code that 'echo' of php code from html code.

For example, Just like this. http://www.accessify.com/tools-and-wizards/developer-tools/html-javascript-convertor/

This is a convert tool for JS printing code from html.

Conclude, I would like to see below

from

<div id="foo">
 <div id="bar">
 </div>
</div>

to

echo '<div id="foo">';
 echo '<div id="bar">';
 echo '</div>';
echo '</div>';

Thank you for read.

  • 1
    Hi! What did you try yet? Did you have a look to the php documentation? – Joël Jan 12 '17 at 09:30
  • HI! I know but i'm just finding a converting tool. Is there about like this tool in the php doc? –  Jan 12 '17 at 11:46
  • Ok, I thought you were trying to write a code, and not that you were searching for one. Maybe you could clarify your request then. As of me, I don't know. – Joël Jan 17 '17 at 15:04

1 Answers1

0

Not sure if this is what you are looking for but you can echo multiple lines of text like this:

echo <<< EOT
<div id="foo">
<div id="bar">
</div>
</div>
EOT;
Michael
  • 405
  • 4
  • 10
  • Just a note to this, do not put a space infront of EOT; as it then will be considered as part of your string. – Michael Jan 12 '17 at 09:23