Jump to content

[SOLVED] General Coding Question


inferium

Recommended Posts

Let's say that this is an actually good illustration. I want to take a piece of displayed html and have the code for it layed out in a text box at the bottom of the page (I'm finding it hard to describe this in words so this paint image is the best I can do, sorry guys !!! :) )

 

Would this be a php maneuver, or is this done through other means?

 

 

picoh.jpg

Link to comment
https://forums.phpfreaks.com/topic/135958-solved-general-coding-question/
Share on other sites

Only other thing i can suggest is using maybe an iframe or ajax and then view-source:http://www.website.com using a regex to find certain bits you want which you would surround in either certain tags or comments.

 

I hope you realize that view-source: is just a browser thing to make lives easier, correct?

<?php
$html = <<<HTMLSTUFF
<html>
<head>
   <!-- header stuff here -->
</head>
<body>
   more blah blah blah
   <a href='http://www.ohtehblah.com'>blah!</a>
</body>
</html>
HTMLSTUFF;

echo $html;

// example 1
echo "<pre>";
echo htmlentities($html);
echo "</pre>";

// example 2
echo "<textarea cols = '80' rows = '10'>";
echo htmlentities($html);
echo "</textarea>";
?>

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.